Class Dorm

Description

"object" is ALWAYS used for Dorm_Object instances

"domain_object" is ALWAYS used for domain objects

Located in /Dorm.php (line 17)


	
			
Class Constant Summary
Variable Summary
static integer $cacheType
Method Summary
Dorm __construct ([string $config_path = null])
void delete ( $domain_object)
boolean flushCache ()
object Loaded get (string $class, mixed $id)
array getCollection (string $class, string $where,  $where_values,  $order, string $limit)
PDO getConnection ()
Dorm_Object getDormObject (string|object  $class, [array $id = null])
array getId (object $domain_object)
Dorm_Map getMap (string|Dorm_Object $class)
void load (Dorm_Object|object  $object)
void normalizeId (string $class, mixed $id)
void save (object $domain_object)
void setCacheType ( $cache_type, integer $cache)
void setDataMapperClass ( $object_class,  $data_mapper_class)
void __call ( $method_name,  $arguments)
Variables
static integer $cacheType = self::CACHE_FILESYSTEM (line 28)

Default cache system.

  • access: public
Methods
Constructor __construct (line 57)
  • access: public
Dorm __construct ([string $config_path = null])
  • string $config_path: Path to XML config file.
delete (line 276)
  • todo: Remove $object from identityMap after deleting
  • access: public
void delete ( $domain_object)
  • $domain_object
flushCache (line 336)
  • access: public
boolean flushCache ()
get (line 98)

Get an object from the database, load it and return it.

  • return: domain object
  • access: public
object Loaded get (string $class, mixed $id)
  • string $class
  • mixed $id
getCache (line 308)
  • access: public
Dorm_Cache_Abstract getCache ()
getCollection (line 186)

Load an object collection from the database.

  • return: of domain objects
  • access: public
array getCollection (string $class, string $where,  $where_values,  $order, string $limit)
  • string $class
  • string $where
  • string $limit: 0,1
  • $where_values
  • $order
getConnection (line 300)

Returns the connection of the first map

  • access: public
PDO getConnection ()
getDataMapper (line 223)
  • todo: Allow users to override the default data mapper (i.e. ClassName_DataMapper could automatically override) if it exists.
  • access: public
Dorm_DataMapper_Abstract getDataMapper (string|Dorm_Object $class)
getDormObject (line 137)

Wraps a domain object with Dorm_Object.

  • access: public
Dorm_Object getDormObject (string|object  $class, [array $id = null])
  • string|object $class
  • array $id
getId (line 260)
  • access: public
array getId (object $domain_object)
  • object $domain_object
getIdentityMap (line 268)
  • access: public
Dorm_IdentityMap getIdentityMap ()
getMap (line 251)

Get Dorm_Map for a specific class.

  • access: public
Dorm_Map getMap (string|Dorm_Object $class)
load (line 113)

Loads an object from the database.

  • access: public
void load (Dorm_Object|object  $object)
normalizeId (line 197)

We need to do this in order to always have consistent IDs

  • todo: this should move in Dorm_Object
  • access: public
void normalizeId (string $class, mixed $id)
  • mixed $id
  • string $class
save (line 167)

Insert/update domain object to the database.

  • access: public
void save (object $domain_object)
  • object $domain_object
setCacheType (line 328)
  • access: public
void setCacheType ( $cache_type, integer $cache)
  • integer $cache
  • $cache_type
setDataMapperClass (line 288)
  • todo:
  • access: public
void setDataMapperClass ( $object_class,  $data_mapper_class)
  • $object_class
  • $data_mapper_class
__call (line 344)

Allows to call $dorm->getClassName(id) instead of $dorm->get('ClassName', id);

  • access: public
void __call ( $method_name,  $arguments)
  • $method_name
  • $arguments
Class Constants
CACHE_APC = 2 (line 20)
CACHE_FILESYSTEM = 3 (line 21)
CACHE_NONE = 1 (line 19)

Documentation generated on Tue, 28 Apr 2009 20:05:29 -0400 by phpDocumentor 1.4.1