diff options
author | xue <> | 2007-10-13 01:48:28 +0000 |
---|---|---|
committer | xue <> | 2007-10-13 01:48:28 +0000 |
commit | dbb73305b29a8cc3b160688e8977049af785ab32 (patch) | |
tree | 1d04885a8fbf159958809e203a8951a6ac453f43 /framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php | |
parent | d92c791ab6be7a5ba9e776fe5ba6b08e7b9c4c9f (diff) |
Active Record now supports implicitly declared related properties
Diffstat (limited to 'framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php')
-rw-r--r-- | framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php b/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php index d4ff07e5..805739c1 100644 --- a/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php +++ b/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php @@ -81,12 +81,11 @@ class TActiveRecordBelongsTo extends TActiveRecordRelation $properties = array_keys($fkeys);
$fields = array_values($fkeys);
-
$indexValues = $this->getIndexValues($properties, $results);
$fkObjects = $this->findForeignObjects($fields, $indexValues);
$this->populateResult($results,$properties,$fkObjects,$fields);
}
-
+
/**
* @return array foreign key field names as key and object properties as value.
* @since 3.1.2
@@ -94,7 +93,7 @@ class TActiveRecordBelongsTo extends TActiveRecordRelation public function getRelationForeignKeys()
{
$fkObject = $this->getContext()->getForeignRecordFinder();
- return $this->findForeignKeys($this->getSourceRecord(),$fkObject);
+ return $this->findForeignKeys($this->getSourceRecord(),$fkObject);
}
/**
@@ -110,7 +109,7 @@ class TActiveRecordBelongsTo extends TActiveRecordRelation {
if(count($collections[$hash]) > 1)
throw new TActiveRecordException('ar_belongs_to_multiple_result');
- $source->setColumnValue($prop, $collections[$hash][0]);
+ $source->$prop=$collections[$hash][0];
}
}
|