TActiveRecordHasOne models the object relationship that a record (the source object) property is an instance of foreign record object having a foreign key related to the source object. The HAS_ONE relation is very similar to the HAS_MANY relationship (in fact, it is equivalent in the entities relationship point of view).
The difference of HAS_ONE from HAS_MANY is that the foreign object is singular. That is, HAS_MANY will return a collection of records while HAS_ONE returns the corresponding record.
Consider the entity relationship between a Car and a Engine.
The car record with engine property list may be fetched as follows.
Located in /Data/ActiveRecord/Relations/TActiveRecordHasOne.php (line 86)
TActiveRecordRelation | --TActiveRecordHasOne
Get the foreign key index values from the results and make calls to the database to find the corresponding foreign objects.
Sets the foreign objects to the given property on the source object.
Updates the associated foreign objects.
Inherited From TActiveRecordRelation
TActiveRecordRelation::__construct()
TActiveRecordRelation::collectForeignObjects()
TActiveRecordRelation::fetchResultsInto()
TActiveRecordRelation::findForeignKeys()
TActiveRecordRelation::findForeignObjects()
TActiveRecordRelation::getContext()
TActiveRecordRelation::getCriteria()
TActiveRecordRelation::getIndexValues()
TActiveRecordRelation::getObjectHash()
TActiveRecordRelation::getRelationForeignKeys()
TActiveRecordRelation::getSourceRecord()
TActiveRecordRelation::populateResult()
TActiveRecordRelation::setObjectProperty()
TActiveRecordRelation::setResultCollection()
TActiveRecordRelation::__call()
Documentation generated on Mon, 25 Jun 2012 14:37:13 +0200 by phpDocumentor 1.4.3