TActiveRecordRelationContext holds information regarding record relationships such as record relation property name, query criteria and foreign object record class names.
This class is use internally by passing a context to the TActiveRecordRelation constructor.
| Method Details |
getAssociationTable
| public string getAssociationTable |
() |
| Output |
|
string
| the M-N relationship association table name. |
| Exception |
|
getCondition
| public string getCondition |
() |
| Output |
|
string
| the query condition for the relation as specified in RELATIONS |
| Exception |
|
getFkField
| public string getFkField |
() |
| Output |
|
string
| foreign key field names, comma delimited. |
| Exception |
|
getForeignRecordClass
| public string getForeignRecordClass |
() |
| Output |
|
string
| foreign record class name. |
| Exception |
|
getForeignRecordFinder
| Output |
|
TActiveRecord
| corresponding relationship foreign object finder instance. |
| Exception |
|
getParameters
| public array getParameters |
() |
| Output |
|
array
| the query parameters for the relation as specified in RELATIONS |
| Exception |
|
getProperty
| public string getProperty |
() |
| Output |
|
string
| name of the record property that the relationship results will be assigned to. |
| Exception |
|
getPropertyValue
| public void getPropertyValue |
() |
|
getRelationForeignKeys
| public array getRelationForeignKeys |
() |
| Output |
|
array
| foreign key of this relations, the keys is dependent on the relationship type. |
| Exception |
|
getRelationHandler
Creates and return the TActiveRecordRelation handler for specific relationships.
An instance of TActiveRecordHasOne, TActiveRecordBelongsTo, TActiveRecordHasMany, or TActiveRecordHasManyAssocation will be returned.
|
getRelationType
| public string getRelationType |
() |
| Output |
|
string
| HAS_MANY, HAS_ONE, or BELONGS_TO |
| Exception |
|
getSourceRecord
| Output |
|
TActiveRecord
| the active record instance that queried for its related records. |
| Exception |
|
hasAssociationTable
| public boolean hasAssociationTable |
() |
| Output |
|
boolean
| true if the relationship is HAS_MANY and requires an association table. |
| Exception |
|
hasFkField
| public boolean hasFkField |
() |
| Output |
|
boolean
| true if the 3rd element of an TActiveRecord::$RELATION entry is set. |
| Exception |
|
hasRecordRelation
| public boolean hasRecordRelation |
() |
| Output |
|
boolean
| true if the relation is defined in TActiveRecord::$RELATIONS |
| Exception |
|
isEmptyFkObject
| protected void isEmptyFkObject |
(mixed $obj ) |
| Input |
| mixed | $obj | |
| Output |
| Exception |
|
updateAssociatedRecords
| public TActiveRecordRelationCommand updateAssociatedRecords |
(mixed $updateBelongsTo ) |
| Input |
| mixed | $updateBelongsTo | |
| Output |
| Exception |
|