## Class TActiveRecordManager

Description

TActiveRecordManager provides the default DB connection, 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 2648 2009-05-10 10:51:52Z godzilla80@gmx.net $
- author: Wei Zhuo <weizho[at]gmail[dot]com>

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

    TComponent
       |
       --TActiveRecordManager

Method Summary
TActiveRecordGateway createRecordGateway ()
ICache getCache ()
TDbConnection getDbConnection ()
TActiveRecordManager getInstance ([mixed $self = null])
TActiveRecordInvalidFinderResult getInvalidFinderResult ()
TActiveRecordGateway getRecordGateway ()
void setCache (ICache $value)
void setDbConnection (TDbConnection $conn)
void setInvalidFinderResult (TActiveRecordInvalidFinderResult $value)
Methods
createRecordGateway (line 113)

- return: default record gateway.
- access: protected

TActiveRecordGateway createRecordGateway ()
getCache (line 57)

- return: application cache.
- access: public

ICache getCache ()
getDbConnection (line 81)

- return: default database connection
- access: public

TDbConnection getDbConnection ()
getInstance (line 89)

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

TActiveRecordManager getInstance ([mixed $self = null])
getInvalidFinderResult (line 123)

- return: Defaults to 'Null'.
- access: public
- see: TActiveRecordManager::setInvalidFinderResult()
- since: 3.1.5

TActiveRecordInvalidFinderResult getInvalidFinderResult ()
getRecordGateway (line 102)

- return: record gateway.
- access: public

TActiveRecordGateway getRecordGateway ()
setCache (line 65)

- access: public

void setCache (ICache $value)

- ICache $value: application cache

setDbConnection (line 73)

- access: public

void setDbConnection (TDbConnection $conn)

- TDbConnection $conn: default database connection

setInvalidFinderResult (line 134)

Define the way an active record finder react if an invalid magic-finder invoked

- access: public
- see: TActiveRecordManager::getInvalidFinderResult()
- since: 3.1.5

void setInvalidFinderResult (TActiveRecordInvalidFinderResult $value)

- TActiveRecordInvalidFinderResult $value

#### 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 Mon, 22 Feb 2010 12:16:35 +0000 by phpDocumentor 1.3.0RC4