PHP Класс Prado\Data\ActiveRecord\Relations\TActiveRecordRelation

С версии: 3.1
Показать файл Открыть проект

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

Метод Описание
__call ( $method, $args ) : mixed Dispatch the method calls to the source record finder object. When an instance of TActiveRecord or an array of TActiveRecord is returned the corresponding foreign objects are also fetched and assigned.
__construct ( TActiveRecordRelationContext $context, $criteria )
fetchResultsInto ( $obj ) : boolean Fetch results for current relationship.
getRelationForeignKeys ( ) : array

Защищенные методы

Метод Описание
collectForeignObjects ( &$results )
findForeignKeys ( $from, TActiveRecord $matchesRecord, $loose = false ) : array Returns foreign keys in $fromRecord with source column names as key and foreign column names in the corresponding $matchesRecord as value.
findForeignObjects ( $fields, $indexValues ) : TActiveRecord[] Fetches the foreign objects using TActiveRecord::findAllByIndex()
getContext ( ) : TActiveRecordRelationContext
getCriteria ( ) : TActiveRecordCriteria
getIndexValues ( $keys, $results ) : array Obtain the foreign key index values from the results.
getObjectHash ( $obj, $properties ) : string
getSourceRecord ( ) : TActiveRecord
populateResult ( &$results, $properties, &$fkObjects, $fields ) Populate the results with the foreign objects found.
setObjectProperty ( $source, $properties, &$collections ) Sets the foreign objects to the given property on the source object.
setResultCollection ( array &$results, array &$collections, $properties ) Populates the result array with foreign objects (matched using foreign key hashed property values).

Приватные методы

Метод Описание
getFkFields ( $fkeys ) Find matching foreign key fields from the 3rd element of an entry in TActiveRecord::$RELATION.

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

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

Multiple relationship calls can be chain together.
public __call ( $method, $args ) : mixed
Результат mixed TActiveRecord or array of TActiveRecord results depending on the method called.

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

public __construct ( TActiveRecordRelationContext $context, $criteria )
$context TActiveRecordRelationContext

collectForeignObjects() абстрактный защищенный Метод

abstract protected collectForeignObjects ( &$results )

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

Fetch results for current relationship.
public fetchResultsInto ( $obj ) : boolean
Результат boolean always true.

findForeignKeys() защищенный Метод

The method returns the first matching foreign key between these 2 records.
protected findForeignKeys ( $from, TActiveRecord $matchesRecord, $loose = false ) : array
$matchesRecord Prado\Data\ActiveRecord\TActiveRecord
Результат array foreign keys with source column names as key and foreign column names as value.

findForeignObjects() защищенный Метод

Fetches the foreign objects using TActiveRecord::findAllByIndex()
protected findForeignObjects ( $fields, $indexValues ) : TActiveRecord[]
Результат Prado\Data\ActiveRecord\TActiveRecord[] foreign objects.

getContext() защищенный Метод

protected getContext ( ) : TActiveRecordRelationContext
Результат TActiveRecordRelationContext

getCriteria() защищенный Метод

protected getCriteria ( ) : TActiveRecordCriteria
Результат TActiveRecordCriteria

getIndexValues() защищенный Метод

Obtain the foreign key index values from the results.
protected getIndexValues ( $keys, $results ) : array
Результат array foreign key index values.

getObjectHash() защищенный Метод

protected getObjectHash ( $obj, $properties ) : string
Результат string object hash using crc32 and serialize.

getRelationForeignKeys() абстрактный публичный Метод

С версии: 3.1.2
abstract public getRelationForeignKeys ( ) : array
Результат array foreign key field names as key and object properties as value.

getSourceRecord() защищенный Метод

protected getSourceRecord ( ) : TActiveRecord
Результат Prado\Data\ActiveRecord\TActiveRecord

populateResult() защищенный Метод

Populate the results with the foreign objects found.
protected populateResult ( &$results, $properties, &$fkObjects, $fields )

setObjectProperty() защищенный Метод

Sets the foreign objects to the given property on the source object.
protected setObjectProperty ( $source, $properties, &$collections )

setResultCollection() защищенный Метод

Populates the result array with foreign objects (matched using foreign key hashed property values).
protected setResultCollection ( array &$results, array &$collections, $properties )
$results array
$collections array