Class Xyster_Orm_Mapper

Description

A SQL implementation of the mapper interface

Located in /Orm/Mapper.php (line 34)

Xyster_Orm_Mapper_Abstract
   |
   --Xyster_Orm_Mapper
Variable Summary
Zend_Db_Adapter_Abstract $_db
array $_metadata
Zend_Cache_Core $_metadataCache
Method Summary
static void dsn (string $dsn, string $driver, [ $config = array()])
Xyster_Orm_Mapper __construct (Xyster_Orm_Mapper_Factory_Interface $factory, [ $cache = null])
Xyster_Orm_Entity find (mixed $criteria)
Xyster_Orm_Set findAll (mixed $criteria, [mixed $sort = null])
Xyster_Orm_Set getAll ([ $ids = array()])
array getFields ()
Zend_Cache_Core getMetadataCache ()
string getSequence ()
void refresh (Xyster_Orm_Entity $entity)
Zend_Db_Select _buildSimpleSelect ()
int _delete ( $where)
Zend_Db_Statement_Interface _fetchOne ( $where)
Zend_Db_Adapter_Abstract _getAdapter ()
mixed _insert (Xyster_Orm_Entity $entity)
Xyster_Orm_Entity _mapEntity ( $stmt, [Xyster_Orm_Entity $entity = null])
array _selectColumns ()
Zend_Cache_Core _setupMetadataCache (mixed $metadataCache)
void _update (Xyster_Orm_Entity $entity)
Variables
Zend_Db_Adapter_Abstract $_db (line 41)

The data adapter

  • access: protected
array $_metadata = array() (line 49)

Information provided by the getFields() method

Zend_Cache_Core $_metadataCache (line 56)

Cache for information provided the backend's getFields method

  • access: protected

Inherited Variables

Inherited from Xyster_Orm_Mapper_Abstract

Xyster_Orm_Mapper_Abstract::$_domain
Xyster_Orm_Mapper_Abstract::$_factory
Xyster_Orm_Mapper_Abstract::$_index
Xyster_Orm_Mapper_Abstract::$_lifetime
Xyster_Orm_Mapper_Abstract::$_options
Xyster_Orm_Mapper_Abstract::$_table
Methods
static method dsn (line 85)

Sets up a nickname for a database adapter

This method adds a Zend_Db_Adapter_Abstract to the Zend_Registry so it can be retrieved later.

  • access: public
static void dsn (string $dsn, string $driver, [ $config = array()])
  • string $dsn
  • string $driver
  • array $config
Constructor __construct (line 64)

Creates a new mapper

  • access: public
Xyster_Orm_Mapper __construct (Xyster_Orm_Mapper_Factory_Interface $factory, [ $cache = null])

Redefinition of:
Xyster_Orm_Mapper_Abstract::__construct()
Creates a new mapper
find (line 101)

Gets the first entity from the data store matching the criteria

  • return: The entity found
  • access: public
Xyster_Orm_Entity find (mixed $criteria)
  • mixed $criteria
findAll (line 114)

Gets all entities from the data store matching the criteria

  • return: A collection of the entities
  • access: public
Xyster_Orm_Set findAll (mixed $criteria, [mixed $sort = null])
  • mixed $criteria
  • mixed $sort
getAll (line 147)

Gets all entities from the data store

  • return: A collection of the entities
  • access: public
Xyster_Orm_Set getAll ([ $ids = array()])
  • array $ids: An array of ids for which entities to retrieve
getFields (line 179)

Gets the fields for an entity as they appear in the backend

The array should come in the format of the describeTable method of the Zend_Db_Adapter_Abstract class.

  • see: Zend_Db_Adapter_Abstract::describeTable
  • access: public
array getFields ()
getJoined (line 215)

Gets entities via a many-to-many table

  • access: public
Xyster_Orm_Set getJoined (Xyster_Orm_Entity $entity, Xyster_Orm_Relation $relation)
getMetadataCache (line 270)

Gets the metadata cache

  • access: public
Zend_Cache_Core getMetadataCache ()
getSequence (line 280)

Gets the sequence of this table

  • return: The sequence
  • access: public
string getSequence ()
query (line 291)

Performs a query

  • access: public
refresh (line 397)

Reloads an entity's values with fresh ones from the backend

  • access: public
void refresh (Xyster_Orm_Entity $entity)
_buildSimpleSelect (line 407)

Gets a simple Select object for this table

  • access: protected
Zend_Db_Select _buildSimpleSelect ()
_buildTranslator (line 420)

Gets a Mapper Translator object

  • access: protected
Xyster_Db_Translator _buildTranslator ()
_delete (line 434)

Removes entities from the backend

  • return: The number of rows deleted
  • access: protected
int _delete ( $where)

Redefinition of:
Xyster_Orm_Mapper_Abstract::_delete()
Removes entities from the backend
_fetchOne (line 452)

Fetches one record

  • access: protected
Zend_Db_Statement_Interface _fetchOne ( $where)
_getAdapter (line 470)

Gets a connection to the database

  • return: A connection to the database
  • throws: Xyster_Orm_Mapper_Exception
  • access: protected
Zend_Db_Adapter_Abstract _getAdapter ()
_insert (line 493)

Saves a new entity into the backend

  • return: The new primary key
  • access: protected
mixed _insert (Xyster_Orm_Entity $entity)

Redefinition of:
Xyster_Orm_Mapper_Abstract::_insert()
Saves a new entity into the backend
_joinedDelete (line 622)

Removes the entities from the many-to-many join

  • access: protected
void _joinedDelete (Xyster_Orm_Set $set)

Redefinition of:
Xyster_Orm_Mapper_Abstract::_joinedDelete()
Removes the entity from the many-to-many join
_joinedInsert (line 589)

Adds the entities to the many-to-many join

  • access: protected
void _joinedInsert (Xyster_Orm_Set $set)

Redefinition of:
Xyster_Orm_Mapper_Abstract::_joinedInsert()
Adds the entity to the many-to-many join
_mapEntity (line 670)

Translates the first row of a database recordset into an entity

  • return: The translated entity
  • access: protected
Xyster_Orm_Entity _mapEntity ( $stmt, [Xyster_Orm_Entity $entity = null])
  • Zend_Db_Statement_Interface $stmt: A statement containing the row to translate
  • Xyster_Orm_Entity $entity: Optional. An entity to refresh
_mapSet (line 693)

Translates a database recordset into an entity set

  • return: The translated set
  • access: protected
Xyster_Orm_Set _mapSet ( $stmt)
  • Zend_Db_Statement_Interface $stmt: A statement containing rows to translate
_selectColumns (line 713)

Gets the columns to select

  • access: protected
array _selectColumns ()
_setupMetadataCache (line 728)
  • throws: Xyster_Orm_Mapper_Exception
  • access: protected
Zend_Cache_Core _setupMetadataCache (mixed $metadataCache)
  • mixed $metadataCache: Either a Cache object, or a string naming a Registry key
_update (line 749)

Updates the values of an entity in the backend

  • throws: Xyster_Orm_Mapper_Exception if the record was modified or deleted
  • access: protected
void _update (Xyster_Orm_Entity $entity)

Redefinition of:
Xyster_Orm_Mapper_Abstract::_update()
Updates the values of an entity in the backend

Inherited Methods

Inherited From Xyster_Orm_Mapper_Abstract

Xyster_Orm_Mapper_Abstract::__construct()
Xyster_Orm_Mapper_Abstract::delete()
Xyster_Orm_Mapper_Abstract::get()
Xyster_Orm_Mapper_Abstract::getDomain()
Xyster_Orm_Mapper_Abstract::getEntityName()
Xyster_Orm_Mapper_Abstract::getEntityType()
Xyster_Orm_Mapper_Abstract::getFactory()
Xyster_Orm_Mapper_Abstract::getIndex()
Xyster_Orm_Mapper_Abstract::getLifetime()
Xyster_Orm_Mapper_Abstract::getOption()
Xyster_Orm_Mapper_Abstract::getOptions()
Xyster_Orm_Mapper_Abstract::getSet()
Xyster_Orm_Mapper_Abstract::getTable()
Xyster_Orm_Mapper_Abstract::init()
Xyster_Orm_Mapper_Abstract::save()
Xyster_Orm_Mapper_Abstract::translateField()
Xyster_Orm_Mapper_Abstract::untranslateField()
Xyster_Orm_Mapper_Abstract::_addValidators()
Xyster_Orm_Mapper_Abstract::_assertThisType()
Xyster_Orm_Mapper_Abstract::_belongsTo()
Xyster_Orm_Mapper_Abstract::_buildCriteria()
Xyster_Orm_Mapper_Abstract::_checkPrimaryKey()
Xyster_Orm_Mapper_Abstract::_checkPropertyNames()
Xyster_Orm_Mapper_Abstract::_create()
Xyster_Orm_Mapper_Abstract::_delete()
Xyster_Orm_Mapper_Abstract::_hasJoined()
Xyster_Orm_Mapper_Abstract::_hasMany()
Xyster_Orm_Mapper_Abstract::_hasOne()
Xyster_Orm_Mapper_Abstract::_insert()
Xyster_Orm_Mapper_Abstract::_joinedDelete()
Xyster_Orm_Mapper_Abstract::_joinedInsert()
Xyster_Orm_Mapper_Abstract::_update()

Documentation generated on Mon, 19 May 2008 17:07:28 -0400 by phpDocumentor 1.4.2