summaryrefslogtreecommitdiff
path: root/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php')
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php b/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php
index cbba3ebd..f7426862 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
* TActiveRecordHasMany class file.
*
@@ -75,8 +75,7 @@ class TActiveRecordHasMany extends TActiveRecordRelation
*/
protected function collectForeignObjects(&$results)
{
- $fkObject = $this->getContext()->getForeignRecordFinder();
- $fkeys = $this->findForeignKeys($fkObject, $this->getSourceRecord());
+ $fkeys = $this->getRelationForeignKeys();
$properties = array_values($fkeys);
$fields = array_keys($fkeys);
@@ -87,6 +86,16 @@ class TActiveRecordHasMany extends TActiveRecordRelation
}
/**
+ * @return array foreign key field names as key and object properties as value.
+ * @since 3.1.2
+ */
+ public function getRelationForeignKeys()
+ {
+ $fkObject = $this->getContext()->getForeignRecordFinder();
+ return $this->findForeignKeys($fkObject, $this->getSourceRecord());
+ }
+
+ /**
* Updates the associated foreign objects.
* @return boolean true if all update are success (including if no update was required), false otherwise .
*/
@@ -113,5 +122,5 @@ class TActiveRecordHasMany extends TActiveRecordRelation
return $success;
}
}
-
+
?> \ No newline at end of file