PHP Class Prado\Data\ActiveRecord\TActiveRecordConfig

Database configuration for the default ActiveRecord manager instance. Example: application.xml configuration MySQL database definition: CREATE TABLE blogs ( blog_id int(10) unsigned NOT NULL auto_increment, blog_name varchar(255) NOT NULL, blog_author varchar(255) NOT NULL, PRIMARY KEY (blog_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Record php class: class Blogs extends TActiveRecord { public $blog_id; public $blog_name; public $blog_author; public static function finder($className=__CLASS__) { return parent::finder($className); } } Usage example: class Home extends TPage { function onLoad($param) { $blogs = Blogs::finder()->findAll(); print_r($blogs); } }
Since: 3.1
Inheritance: extends Prado\Data\TDataSourceConfig
Datei anzeigen Open project: pradosoft/prado

Public Methods

Method Description
getEnableCache ( ) : boolean
getGatewayClass ( ) : string
getInvalidFinderResult ( ) : TActiveRecordInvalidFinderResult
getManager ( ) : TActiveRecordManager
getManagerClass ( ) : string
init ( $xml ) Initialize the active record manager.
setEnableCache ( $value ) Set true to cache the table meta data.
setGatewayClass ( string $value ) Set implementation class of ActiveRecordGateway
setInvalidFinderResult ( $value ) Define the way an active record finder react if an invalid magic-finder invoked
setManagerClass ( string $value ) Set implementation class of ActiveRecordManager

Method Details

getEnableCache() public method

public getEnableCache ( ) : boolean
return boolean true if table meta data should be cached, false otherwise.

getGatewayClass() public method

public getGatewayClass ( ) : string
return string the implementation class of ActiveRecordGateway. Defaults to {@link TActiveRecordConfig::DEFAULT_GATEWAY_CLASS DEFAULT_GATEWAY_CLASS}

getInvalidFinderResult() public method

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

getManager() public method

public getManager ( ) : TActiveRecordManager
return TActiveRecordManager

getManagerClass() public method

public getManagerClass ( ) : string
return string the implementation class of ActiveRecordManager. Defaults to {@link TActiveRecordConfig::DEFAULT_GATEWAY_CLASS DEFAULT_MANAGER_CLASS}

init() public method

Initialize the active record manager.
public init ( $xml )

setEnableCache() public method

Set true to cache the table meta data.
public setEnableCache ( $value )

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 )

setManagerClass() public method

Set implementation class of ActiveRecordManager
public setManagerClass ( string $value )
$value string