mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-05 23:58:49 +02:00
Merge pull request #2462 from ajshort/has-many-list-foreign-getter
Add a getter for the HasManyList foreign key.
This commit is contained in:
commit
84cedcda44
@ -26,6 +26,15 @@ class HasManyList extends RelationList {
|
|||||||
$this->foreignKey = $foreignKey;
|
$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) {
|
protected function foreignIDFilter($id = null) {
|
||||||
if ($id === null) $id = $this->getForeignID();
|
if ($id === null) $id = $this->getForeignID();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user