Class Xyster_Orm_Manager

Description

The main backend of the orm package

  • copyright: Copyright (c) 2007-2008 Irrational Logic (http://irrationallogic.net)
  • license: New BSD License

Located in /Orm/Manager.php (line 32)


	
			
Variable Summary
Method Summary
Xyster_Orm_Manager __construct ()
void clear ()
Xyster_Orm_Entity find (string $className,  $criteria)
void findAll (string $className, mixed $criteria, [mixed $sorts = null])
Xyster_Orm_Entity get (string $className, mixed $id)
Xyster_Orm_Set getAll (string $className, [ $ids = null])
Xyster_Orm_Entity getFromCache (string $className, mixed $id, [boolean $checkSecondary = false])
Xyster_Orm_Set getJoined (Xyster_Orm_Entity $entity, Xyster_Orm_Relation $relation, string $className)
Zend_Cache_Core getSecondaryCache ()
void refresh (Xyster_Orm_Entity $entity)
void setSecondaryCache ([mixed $cache = null])
Xyster_Orm_Entity _getFromSecondaryCache (string $className, array $id)
Zend_Cache_Core _setupSecondaryCache (mixed $cache)
Variables
Xyster_Orm_Mapper_Factory_Interface $_mapFactory (line 39)

The mapper factory

  • access: protected
Xyster_Orm_Plugin_Broker $_plugins (line 60)

The plugin broker

  • access: protected
Xyster_Orm_Repository $_repository (line 46)

The repository for storing entities

  • access: protected
Zend_Cache_Core $_secondaryCache (line 53)

The secondary cache

  • access: protected
Methods
Constructor __construct (line 66)

Creates a new Orm_Manager

  • access: public
Xyster_Orm_Manager __construct ()
clear (line 75)

Clears out the repository

  • access: public
void clear ()
executeQuery (line 86)

Executes a query or report query

  • access: public
Xyster_Data_Set executeQuery (Xyster_Orm_Query $query)
find (line 106)

Gets the first entity found matching a set of criteria

  • return: The entity found or null if none
  • access: public
Xyster_Orm_Entity find (string $className,  $criteria)
  • string $className
  • array $criteria
findAll (line 131)

Finds all entities matching a given criteria

  • access: public
void findAll (string $className, mixed $criteria, [mixed $sorts = null])
get (line 147)

Gets an entity by class and primary key

  • access: public
Xyster_Orm_Entity get (string $className, mixed $id)
  • string $className
  • mixed $id
getAll (line 177)

Gets all entities from the data source or a subset if given the keys

  • access: public
Xyster_Orm_Set getAll (string $className, [ $ids = null])
  • string $className
  • array $ids
getFromCache (line 233)

Tries to load an entity from the cache

This method will return null if the entity isn't in either cache

  • access: public
Xyster_Orm_Entity getFromCache (string $className, mixed $id, [boolean $checkSecondary = false])
  • string $className
  • mixed $id
  • boolean $checkSecondary: Whether to also check the secondary cache
getJoined (line 265)

Gets entities via a many-to-many table

  • access: public
Xyster_Orm_Set getJoined (Xyster_Orm_Entity $entity, Xyster_Orm_Relation $relation, string $className)
getMapperFactory (line 278)

Gets the factory for entity mappers

  • access: public
getPluginBroker (line 292)

Gets the plugin broker

  • access: public
Xyster_Orm_Plugin_Broker getPluginBroker ()
getRepository (line 302)

Gets the entity repository

  • access: public
Xyster_Orm_Repository getRepository ()
getSecondaryCache (line 315)

Gets the secondary repository for storing entities

  • access: public
Zend_Cache_Core getSecondaryCache ()
putAllInSecondaryCache (line 412)

Convenience method to put all entities in a set in the cache

  • access: public
void putAllInSecondaryCache (Xyster_Orm_Set $set)
putInSecondaryCache (line 386)

Puts the entity in the secondary cache

  • access: public
void putInSecondaryCache (Xyster_Orm_Entity $entity)
refresh (line 323)

Refreshes the values of an entity

  • access: public
void refresh (Xyster_Orm_Entity $entity)
setMapperFactory (line 336)

Sets the factory for entity mappers

This method also calls the Xyster_Orm_Mapper_Factory_Interface::setManager method.

  • access: public
void setMapperFactory (Xyster_Orm_Mapper_Factory_Interface $mapFactory)
setSecondaryCache (line 349)

Sets the secondary cache for storing entities

If $cache is null, then no secondary cache is used.

  • access: public
void setSecondaryCache ([mixed $cache = null])
  • mixed $cache: Either a Cache object, or a string naming a Registry key
_entityToShell (line 426)

Turns an entity into a shell for storage

  • access: protected
array _entityToShell (Xyster_Orm_Entity $entity, Xyster_Orm_Entity_Type $meta)
_getFromSecondaryCache (line 361)

Gets an entity from the secondary cache

  • return: the entity found or null if none
  • access: protected
Xyster_Orm_Entity _getFromSecondaryCache (string $className, array $id)
  • string $className
  • array $id
_setupSecondaryCache (line 480)
  • throws: Xyster_Orm_Exception
  • access: protected
Zend_Cache_Core _setupSecondaryCache (mixed $cache)
  • mixed $cache: Either a Cache object, or a string naming a Registry key
_shellToEntity (line 452)

Take the serialized array and turn it back into an entity

  • access: protected
Xyster_Orm_Entity _shellToEntity ( $shell, Xyster_Orm_Entity_Type $meta)

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