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:

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.

  • author: Wei Zhuo <weizho[at]gmail[dot]com>
  • version: $Id: TActiveRecordManager.php 3030 2011-08-28 05:51:36Z GODZilla0480@gmail.com $
  • since: 3.1

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

TComponent
   |
   --TActiveRecordManager
Class Constant Summary
 DEFAULT_GATEWAY_CLASS = 'System.Data.ActiveRecord.TActiveRecordGateway'
Method Summary
Methods
static method getInstance (line 97)
  • return: static instance of record manager.
  • access: public
static TActiveRecordManager getInstance ([ $self = null])
  • $self
createRecordGateway (line 121)
  • return: default record gateway.
  • access: protected
TActiveRecordGateway createRecordGateway ()
getCache (line 65)
  • return: application cache.
  • access: public
ICache getCache ()
getDbConnection (line 89)
  • return: default database connection
  • access: public
TDbConnection getDbConnection ()
getGatewayClass (line 138)
  • return: the implementation class of ActiveRecordGateway. Defaults to DEFAULT_GATEWAY_CLASS
  • access: public
string getGatewayClass ()
getInvalidFinderResult (line 148)
TActiveRecordInvalidFinderResult getInvalidFinderResult ()
getRecordGateway (line 110)
  • return: record gateway.
  • access: public
TActiveRecordGateway getRecordGateway ()
setCache (line 73)
  • access: public
void setCache (ICache $value)
  • ICache $value: application cache
setDbConnection (line 81)
  • access: public
void setDbConnection (TDbConnection $conn)
setGatewayClass (line 130)

Set implementation class of ActiveRecordGateway

  • access: public
void setGatewayClass (string $value)
  • string $value
setInvalidFinderResult (line 159)

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

void setInvalidFinderResult (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::__call()
TComponent::__get()
TComponent::__set()
TComponent::__sleep()
TComponent::__wakeup()
Class Constants
DEFAULT_GATEWAY_CLASS = 'System.Data.ActiveRecord.TActiveRecordGateway' (line 40)

Documentation generated on Mon, 25 Jun 2012 14:37:14 +0200 by phpDocumentor 1.4.3