## Class TActiveRecordManager

Description

TActiveRecordManager provides the default DB connection, default object state registry, default active record gateway, and table meta data inspector.

The default connection can be set as follows:

     TActiveRecordManager::getInstance()->setDbConnection($conn);

All new active record created after setting the DbConnection will use that connection unless the custom ActiveRecord class overrides the ActiveRecord::getDbConnection().

Set the Cache property to an ICache object to allow the active record gateway to cache the table meta data information.

- since: 3.1
- version: $Id: TActiveRecordManager.php 1869 2007-04-16 02:02:27Z wei $
- author: Wei Zhuo <weizho[at]gmail[dot]com>

Located in /Data/ActiveRecord/TActiveRecordManager.php (line 39)

    TComponent
       |
       --TActiveRecordManager

Method Summary
TActiveRecordStateRegistry createObjectStateRegistry ()
TActiveRecordGateway createRecordGateway ()
ICache getCache ()
TDbConnection getDbConnection ()
TActiveRecordManager getInstance ([mixed $self = null])
TActiveRecordStateRegistry getObjectStateRegistry ()
TActiveRecordGateway getRecordGateway ()
void setCache (ICache $value)
void setDbConnection (TDbConnection $conn)
Methods
createObjectStateRegistry (line 106)

- return: default object registry.
- access: protected

TActiveRecordStateRegistry createObjectStateRegistry ()
createRecordGateway (line 124)

- return: default record gateway.
- access: protected

TActiveRecordGateway createRecordGateway ()
getCache (line 51)

- return: application cache.
- access: public

ICache getCache ()
getDbConnection (line 75)

- return: default database connection
- access: public

TDbConnection getDbConnection ()
getInstance (line 83)

- return: static instance of record manager.
- static:
- access: public

TActiveRecordManager getInstance ([mixed $self = null])
getObjectStateRegistry (line 96)

- return: record object registry.
- access: public

TActiveRecordStateRegistry getObjectStateRegistry ()
getRecordGateway (line 114)

- return: record gateway.
- access: public

TActiveRecordGateway getRecordGateway ()
setCache (line 59)

- access: public

void setCache (ICache $value)

- ICache $value: application cache

setDbConnection (line 67)

- access: public

void setDbConnection (TDbConnection $conn)

- TDbConnection $conn: default database connection

#### Inherited Methods

Inherited From TComponent

> TComponent::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Documentation generated on Sun, 30 Sep 2007 19:10:28 -0400 by phpDocumentor 1.3.0RC4