PHP 클래스 Prado\Data\ActiveRecord\Relations\TActiveRecordRelation

부터: 3.1
파일 보기 프로젝트 열기: pradosoft/prado

공개 메소드들

메소드 설명
__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