Model configuration

In Porte, the Object Relational Mapping (ORM) pattern is based on the mapping between tables and classes.

Each type of record, stored as a table in a database, is associated to a table model and identified by a property "type". Model configuration is done at class level through the configuration of two properties with array type: "meta_table" and "meta_fields".

Defining a model

There exists one model per type of record. When a new type of record is initialized, Porte will look for its configuration and create a new model instance. The result is than cached in the connection object.

Accessing a model

Models can be accessed from instance of "PorteConnection", "PorteTable", "PorteRecords" and "PorteIterator".

Open Source Object Relational Mapping in PHP

Download Porte 0.2.1