Implements interfaces:
An abstract implementation of the mapper interface
This class allows for a more simple implementation of the mapper interface, taking care of common logic.
Located in /Orm/Mapper/Abstract.php (line 47)
Class | Description |
---|---|
Xyster_Orm_Mapper | A SQL implementation of the mapper interface |
The domain associated with the entity
The factory that created this mapper
An array of properties used to index the entity by value
The array consists of index names as keys and arrays of the columns contained within as values.
The period of time entities should persist in the secondary cache
A value of -1 means the entity shouldn't be added to secondary cache. A value of 0 means the entity should be stored indefinitely.
Any additional options
<dl> <dt>metadataCache</dt><dd>The name of the Zend_Registry key to find a Zend_Cache_Core object for caching metadata information. If not specified, the mapper will use the defaultMetadataCache.</dd> <dt>doNotRefreshAfterSave</dt><dd>This will cause the mapper not to refresh the entity after it's inserted or updated.</dd> <dt>locking</dt><dd>The name of the field which holds an integer version number of the record (used to avoid concurrent changes)</dd> <dt>doNotCreateValidators</dt><dd>This will cause the mapper not to create validators from the constraints in the data store.</dd> </dl>
The name of the table, defaults to entity name
Creates a new mapper
Class authors can overwrite this, but <em>be sure to call the parent</em>
Deletes an entity
Gets an entity with the supplied identifier
Gets the name of the domain to which this mapper belongs
Gets the class name of the entity
Class authors should overwrite this method if their entity name isn't the same as the mapper name.
Gets the entity metadata
Gets the factory that created this mapper
Gets the columns that should be used to index the entity
The array consists of index names as keys and arrays of the columns contained within as values.
Gets the time in seconds an entity should be cached
Gets the value of an option
Gets the options for this mapper
Gets an empty entity set for the mapper's entity type
Gets the table from which an entity comes
It is up to the Xyster_Orm_Backend to do something with this value.
Allows for subclassing without overwriting constructor
The mapper factory calls this method. This is necessary because the init method should contain the setup of relations, which might depend on the mapper that's still being instantiated in the factory.
Saves an entity (insert or update)
Adds the validators from the constraints in the data store
Right now we add a NotEmpty validator for fields declared as NOT NULL. We also try to match integer types in the form of TINYINT, BIGINT, SMALLINT, INT, INTEGER and any variations. We also try to match float values in the form of FLOAT, REAL, DOUBLE, and DOUBLE PRECISION.
Convenience method to create a 'belongs' relationship
Ensures the parameter passed is a Criterion
Checks an array for correct primary key names
Asserts the correct property names in a criteria array
Creates an entity from the row supplied
If the row has already been loaded and the entity that represents the row is in the repository, this method will return that exact instance instead of creating a new one.
Removes entities from the backend
Convenience method to create a 'many to many' relationship
Convenience method to create a 'one to many' relationship
Convenience method to create a 'one to one' relationship
Saves a new entity into the backend
Removes the entity from the many-to-many join
Adds the entity to the many-to-many join
Updates the values of an entity in the backend
Class authors must remember to implement optimistic offline locking in this method. See the Xyster_Orm_Mapper::_update method for an example.
Documentation generated on Mon, 19 May 2008 17:06:53 -0400 by phpDocumentor 1.4.2