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.
Since: 3.1
Inheritance: extends Prado\TComponent
显示文件 Open project: pradosoft/prado Class Usage Examples

Public Methods

Method Description
getCache ( ) : ICache
getDbConnection ( ) : TDbConnection
getGatewayClass ( ) : string
getInstance ( $self = null ) : TActiveRecordManager
getInvalidFinderResult ( ) : TActiveRecordInvalidFinderResult
getRecordGateway ( ) : TActiveRecordGateway
setCache ( $value )
setDbConnection ( $conn )
setGatewayClass ( string $value ) Set implementation class of ActiveRecordGateway
setInvalidFinderResult ( $value ) Define the way an active record finder react if an invalid magic-finder invoked

Protected Methods

Method Description
createRecordGateway ( ) : TActiveRecordGateway

Method Details

createRecordGateway() protected method

protected createRecordGateway ( ) : TActiveRecordGateway
return TActiveRecordGateway default record gateway.

getCache() public method

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

See also: setInvalidFinderResult
Since: 3.1.5
public getInvalidFinderResult ( ) : TActiveRecordInvalidFinderResult
return TActiveRecordInvalidFinderResult Defaults to '{@link TActiveRecordInvalidFinderResult::Null Null}'.

getRecordGateway() public method

public getRecordGateway ( ) : TActiveRecordGateway
return TActiveRecordGateway record gateway.

setCache() public method

public setCache ( $value )

setDbConnection() public method

public setDbConnection ( $conn )

setGatewayClass() public method

Set implementation class of ActiveRecordGateway
public setGatewayClass ( string $value )
$value string

setInvalidFinderResult() public method

Define the way an active record finder react if an invalid magic-finder invoked
See also: getInvalidFinderResult
Since: 3.1.5
public setInvalidFinderResult ( $value )