Merge pull request #1974 from neoascetic/belongs_to_call_a_getter
Access foreign property in Belongs_To through a getter
This commit is contained in:
commit
1fdd186dde
|
@ -110,7 +110,7 @@ public function match($relationship, &$children, $parents)
|
||||||
*/
|
*/
|
||||||
public function foreign_value()
|
public function foreign_value()
|
||||||
{
|
{
|
||||||
return $this->base->get_attribute($this->foreign);
|
return $this->base->{$this->foreign};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -126,4 +126,4 @@ public function bind($id)
|
||||||
return $this->base;
|
return $this->base;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue