## Class TActiveRecordRelationContext

Description

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.

- since: 3.1
- version: $Id$
- author: Wei Zhuo <weizho[at]gmail[dot]com>

Located in /Data/ActiveRecord/Relations/TActiveRecordRelationContext.php (line 26)

Method Summary
TActiveRecordRelationContext __construct (mixed $record, [mixed $property = null], [mixed $relation = null])
string getAssociationTable ()
string getCondition ()
string getFkField ()
string getForeignRecordClass ()
TActiveRecord getForeignRecordFinder ()
array getParameters ()
string getProperty ()
void getPropertyValue ()
array getRelationForeignKeys ()
TActiveRecordRelation getRelationHandler ([TActiveRecordCriteria $criteria = null])
string getRelationType ()
TActiveRecord getSourceRecord ()
boolean hasAssociationTable ()
boolean hasFkField ()
boolean hasRecordRelation ()
void isEmptyFkObject (mixed $obj)
TActiveRecordRelationCommand updateAssociatedRecords ([mixed $updateBelongsTo = false])
Methods
Constructor __construct (line 33)

- access: public

TActiveRecordRelationContext __construct (mixed $record, [mixed $property = null], [mixed $relation = null])
getAssociationTable (line 139)

- return: the M-N relationship association table name.
- access: public

string getAssociationTable ()
getCondition (line 112)

- return: the query condition for the relation as specified in RELATIONS
- access: public
- since: 3.1.2

string getCondition ()
getFkField (line 103)

- return: foreign key field names, comma delimited.
- access: public
- since: 3.1.2

string getFkField ()
getForeignRecordClass (line 94)

- return: foreign record class name.
- access: public

string getForeignRecordClass ()
getForeignRecordFinder (line 156)

- return: corresponding relationship foreign object finder instance.
- access: public

TActiveRecord getForeignRecordFinder ()
getParameters (line 121)

- return: the query parameters for the relation as specified in RELATIONS
- access: public
- since: 3.1.2

array getParameters ()
getProperty (line 58)

- return: name of the record property that the relationship results will be assigned to.
- access: public

string getProperty ()
getPropertyValue (line 49)

- access: public

void getPropertyValue ()
getRelationForeignKeys (line 76)

- return: foreign key of this relations, the keys is dependent on the relationship type.
- access: public
- since: 3.1.2

array getRelationForeignKeys ()
getRelationHandler (line 169)

Creates and return the TActiveRecordRelation handler for specific relationships.

An instance of TActiveRecordHasOne, TActiveRecordBelongsTo, TActiveRecordHasMany, or TActiveRecordHasManyAssocation will be returned.

- return: record relationship handler instnace.
- access: public
- throws: TActiveRecordException if property is not defined or missing.

TActiveRecordRelation getRelationHandler ([TActiveRecordCriteria $criteria = null])

- TActiveRecordCriteria $criteria: search criteria

getRelationType (line 86)

- return: HAS_MANY, HAS_ONE, or BELONGS_TO
- access: public

string getRelationType ()
getSourceRecord (line 66)

- return: the active record instance that queried for its related records.
- access: public

TActiveRecord getSourceRecord ()
hasAssociationTable (line 147)

- return: true if the relationship is HAS_MANY and requires an association table.
- access: public

boolean hasAssociationTable ()
hasFkField (line 130)

- return: true if the 3rd element of an TActiveRecord::$RELATION entry is set.
- access: public
- since: 3.1.2

boolean hasFkField ()
hasRecordRelation (line 44)

- return: true if the relation is defined in TActiveRecord::$RELATIONS
- access: public
- since: 3.1.2

boolean hasRecordRelation ()
isEmptyFkObject (line 220)

- access: protected

void isEmptyFkObject (mixed $obj)
updateAssociatedRecords (line 200)

- access: public

TActiveRecordRelationCommand updateAssociatedRecords ([mixed $updateBelongsTo = false])

Documentation generated on Sun, 11 Jan 2009 20:16:13 -0500 by phpDocumentor 1.3.0RC4