From 43fab1088a7d84fe31254fb198c1cbca25bd4063 Mon Sep 17 00:00:00 2001 From: Andrew Short Date: Fri, 27 Sep 2013 15:06:55 +1000 Subject: [PATCH] Add a getter for the HasManyList foreign key. --- model/HasManyList.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/model/HasManyList.php b/model/HasManyList.php index 7b2159963..7bcb3412f 100644 --- a/model/HasManyList.php +++ b/model/HasManyList.php @@ -25,7 +25,16 @@ class HasManyList extends RelationList { $this->foreignKey = $foreignKey; } - + + /** + * Gets the field name which holds the related object ID. + * + * @return string + */ + public function getForeignKey() { + return $this->foreignKey; + } + protected function foreignIDFilter($id = null) { if ($id === null) $id = $this->getForeignID();