Method Summary |
protected
abstract
void
|
|
boolean
|
Fetch results for current relationship.
|
protected
array
|
Returns foreign keys in $fromRecord with source column names as key and foreign column names in the corresponding $matchesRecord as value.
|
protected
TActiveRecord[]
|
Fetches the foreign objects using TActiveRecord::findAllByIndex()
|
protected
TActiveRecordRelationContext
|
|
protected
TActiveRecordCriteria
|
|
protected
array
|
Obtain the foreign key index values from the results.
|
protected
string
|
|
abstract
array
|
|
protected
TActiveRecord
|
|
protected
void
|
populateResult
( array &$results, array $properties, array &$fkObjects, array $fields)
Populate the results with the foreign objects found.
|
protected
void
|
Sets the foreign objects to the given property on the source object.
|
protected
void
|
Populates the result array with foreign objects (matched using foreign key hashed property values).
|
mixed
|
__call
( string $method, array $args)
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.
|
Method Details |
collectForeignObjects
protected abstract void collectForeignObjects |
(mixed &$results ) |
Input |
mixed | &$results | |
Output |
Exception |
|
fetchResultsInto
public boolean fetchResultsInto |
(mixed $obj ) |
Fetch results for current relationship.
Input |
mixed | $obj | |
Output |
boolean
| always true. |
Exception |
|
findForeignKeys
Returns foreign keys in $fromRecord with source column names as key and foreign column names in the corresponding $matchesRecord as value.
The method returns the first matching foreign key between these 2 records.
Input |
mixed | $from | |
TActiveRecord | $matchesRecord | |
mixed | $loose | |
TActiveRecord | $fromRecord | |
Output |
array
| foreign keys with source column names as key and foreign column names as value. |
Exception |
|
findForeignObjects
protected TActiveRecord[] findForeignObjects |
(array $fields , array $indexValues ) |
Fetches the foreign objects using TActiveRecord::findAllByIndex()
Input |
array | $fields | field names |
array | $indexValues | foreign key index values. |
Output |
TActiveRecord[]
| foreign objects. |
Exception |
|
getContext
|
getCriteria
|
getIndexValues
protected array getIndexValues |
(array $keys , array $results ) |
Obtain the foreign key index values from the results.
Input |
array | $keys | property names |
array | $results | TActiveRecord results |
Output |
array
| foreign key index values. |
Exception |
|
getObjectHash
protected string getObjectHash |
(mixed $obj , array $properties ) |
Input |
mixed | $obj | object or array to be hashed |
array | $properties | name of property for hashing the properties. |
Output |
string
| object hash using crc32 and serialize. |
Exception |
|
getRelationForeignKeys
public abstract array getRelationForeignKeys |
() |
Output |
array
| foreign key field names as key and object properties as value. |
Exception |
|
getSourceRecord
|
populateResult
protected void populateResult |
(array &$results , array $properties , array &$fkObjects , array $fields ) |
Populate the results with the foreign objects found.
Input |
array | &$results | source results |
array | $properties | source property names |
array | &$fkObjects | foreign objects |
array | $fields | foreign object field names. |
Output |
Exception |
|
setObjectProperty
protected void setObjectProperty |
(TActiveRecord $source , array $properties , array &$collections ) |
Sets the foreign objects to the given property on the source object.
Input |
TActiveRecord | $source | source object. |
array | $properties | source properties |
array | &$collections | foreign objects. |
Output |
Exception |
|
setResultCollection
protected void setResultCollection |
(array &$results , array &$collections , array $properties ) |
Populates the result array with foreign objects (matched using foreign key hashed property values).
Input |
array | &$results | |
array | &$collections | |
array | $properties | property names |
Output |
Exception |
|
__call
public mixed __call |
(string $method , array $args ) |
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.
Multiple relationship calls can be chain together.
Input |
string | $method | method name called |
array | $args | method arguments |
Output |
mixed
| TActiveRecord or array of TActiveRecord results depending on the method called. |
Exception |
|