PHP Класс 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); } }
С версии: 3.1
Наследование: extends Prado\Data\TDataSourceConfig
Показать файл Открыть проект

Открытые методы

Метод Описание
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

Описание методов

getEnableCache() публичный Метод

public getEnableCache ( ) : boolean
Результат boolean true if table meta data should be cached, false otherwise.

getGatewayClass() публичный Метод

public getGatewayClass ( ) : string
Результат string the implementation class of ActiveRecordGateway. Defaults to {@link TActiveRecordConfig::DEFAULT_GATEWAY_CLASS DEFAULT_GATEWAY_CLASS}

getInvalidFinderResult() публичный Метод

См. также: setInvalidFinderResult
С версии: 3.1.5
public getInvalidFinderResult ( ) : TActiveRecordInvalidFinderResult
Результат TActiveRecordInvalidFinderResult Defaults to '{@link TActiveRecordInvalidFinderResult::Null Null}'.

getManager() публичный Метод

public getManager ( ) : TActiveRecordManager
Результат TActiveRecordManager

getManagerClass() публичный Метод

public getManagerClass ( ) : string
Результат string the implementation class of ActiveRecordManager. Defaults to {@link TActiveRecordConfig::DEFAULT_GATEWAY_CLASS DEFAULT_MANAGER_CLASS}

init() публичный Метод

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

setEnableCache() публичный Метод

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

setGatewayClass() публичный Метод

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

setInvalidFinderResult() публичный Метод

Define the way an active record finder react if an invalid magic-finder invoked
См. также: getInvalidFinderResult
С версии: 3.1.5
public setInvalidFinderResult ( $value )

setManagerClass() публичный Метод

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