PHP 클래스 Contao\Model\Registry

The class handles traversing a set of models and lazy loads the database result rows upon their first usage.
저자: Tristan Lins ([email protected])
상속: implements Countable
파일 보기 프로젝트 열기: contao/core-bundle 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$arrAliases array Aliases to PK's by table and column
$arrIdentities array Models by object hash
$arrRegistry array Models by table and PK
$objInstance static Object instance (Singleton)

공개 메소드들

메소드 설명
__clone ( ) Prevent cloning of the object (Singleton)
count ( ) : integer Count the elements
fetch ( string $strTable, mixed $varKey, string $strAlias = null ) : Model | null Fetch a model by table name and primary key
fetchByAlias ( string $strTable, string $strAlias, mixed $varValue ) : Model | null Fetch a model by one of its aliases
getInstance ( ) : static Return the current object instance (Singleton)
isRegistered ( Model $objModel ) : boolean Check if a model is registered
isRegisteredAlias ( Model $objModel, string $strAlias, mixed $varValue ) : boolean Check if an alias is registered
register ( Model $objModel ) Register a model in the registry
registerAlias ( Model $objModel, string $strAlias, mixed $varValue ) Register an alias for a model
unregister ( Model $objModel ) Unregister a model from the registry
unregisterAlias ( Model $objModel, string $strAlias, mixed $varValue ) Unregister an alias

보호된 메소드들

메소드 설명
__construct ( ) Prevent direct instantiation (Singleton)

메소드 상세

__clone() 최종 공개 메소드

Prevent cloning of the object (Singleton)
final public __clone ( )

__construct() 보호된 메소드

Prevent direct instantiation (Singleton)
protected __construct ( )

count() 공개 메소드

Count the elements
public count ( ) : integer
리턴 integer The number of models

fetch() 공개 메소드

Fetch a model by table name and primary key
public fetch ( string $strTable, mixed $varKey, string $strAlias = null ) : Model | null
$strTable string The table name
$varKey mixed The key
$strAlias string An optional alias
리턴 Contao\Model | null The model or null

fetchByAlias() 공개 메소드

Fetch a model by one of its aliases
public fetchByAlias ( string $strTable, string $strAlias, mixed $varValue ) : Model | null
$strTable string The table name
$strAlias string The alias
$varValue mixed The alias value
리턴 Contao\Model | null The model or null

getInstance() 공개 정적인 메소드

Return the current object instance (Singleton)
public static getInstance ( ) : static
리턴 static The object instance

isRegistered() 공개 메소드

Check if a model is registered
public isRegistered ( Model $objModel ) : boolean
$objModel Contao\Model The model object
리턴 boolean True if the model is registered

isRegisteredAlias() 공개 메소드

Check if an alias is registered
public isRegisteredAlias ( Model $objModel, string $strAlias, mixed $varValue ) : boolean
$objModel Contao\Model The model object
$strAlias string The alias name
$varValue mixed The value of the alias
리턴 boolean True if the alias is registered

register() 공개 메소드

Register a model in the registry
public register ( Model $objModel )
$objModel Contao\Model The model object

registerAlias() 공개 메소드

Register an alias for a model
public registerAlias ( Model $objModel, string $strAlias, mixed $varValue )
$objModel Contao\Model The model object
$strAlias string The alias name
$varValue mixed The value of the alias

unregister() 공개 메소드

Unregister a model from the registry
public unregister ( Model $objModel )
$objModel Contao\Model The model object

unregisterAlias() 공개 메소드

Unregister an alias
public unregisterAlias ( Model $objModel, string $strAlias, mixed $varValue )
$objModel Contao\Model The model object
$strAlias string The alias name
$varValue mixed The value of the alias

프로퍼티 상세

$arrAliases 보호되어 있는 프로퍼티

Aliases to PK's by table and column
protected array $arrAliases
리턴 array

$arrIdentities 보호되어 있는 프로퍼티

Models by object hash
protected array $arrIdentities
리턴 array

$arrRegistry 보호되어 있는 프로퍼티

Models by table and PK
protected array $arrRegistry
리턴 array

$objInstance 보호되어 있는 정적으로 프로퍼티

Object instance (Singleton)
protected static static $objInstance
리턴 static