PHP Class Prado\Data\ActiveRecord\TActiveRecordManager
The default connection can be set as follows:
TActiveRecordManager::getInstance()->setDbConnection($conn);
All new active record created after setting the
{@link DbConnection setDbConnection()} will use that connection unless
the custom ActiveRecord class overrides the ActiveRecord::getDbConnection().
Set the {@link setCache Cache} property to an ICache object to allow
the active record gateway to cache the table meta data information.
Show file
Open project: pradosoft/prado
Class Usage Examples
Public Methods
Protected Methods
Method Details
createRecordGateway()
protected method
protected createRecordGateway ( ) : TActiveRecordGateway |
return |
TActiveRecordGateway |
default record gateway. |
public getCache ( ) : ICache |
return |
ICache |
application cache. |
getDbConnection()
public method
public getDbConnection ( ) : TDbConnection |
return |
TDbConnection |
default database connection |
getGatewayClass()
public method
public getGatewayClass ( ) : string |
return |
string |
the implementation class of ActiveRecordGateway. Defaults to {@link TActiveRecordManager::DEFAULT_GATEWAY_CLASS DEFAULT_GATEWAY_CLASS} |
getInstance()
public static method
public static getInstance ( $self = null ) : TActiveRecordManager |
return |
TActiveRecordManager |
static instance of record manager. |
getInvalidFinderResult()
public method
public getInvalidFinderResult ( ) : TActiveRecordInvalidFinderResult |
return |
TActiveRecordInvalidFinderResult |
Defaults to '{@link TActiveRecordInvalidFinderResult::Null Null}'. |
getRecordGateway()
public method
public getRecordGateway ( ) : TActiveRecordGateway |
return |
TActiveRecordGateway |
record gateway. |
setDbConnection()
public method
setGatewayClass()
public method
Set implementation class of ActiveRecordGateway
setInvalidFinderResult()
public method
Define the way an active record finder react if an invalid magic-finder invoked