Commit 641ac8d6 authored by Pavel Puchkin's avatar Pavel Puchkin

Access foreign property in Belongs_To through a getter

parent cffded66
......@@ -110,7 +110,7 @@ class Belongs_To extends Relationship {
*/
public function foreign_value()
{
return $this->base->get_attribute($this->foreign);
return $this->base->{$this->foreign};
}
/**
......@@ -126,4 +126,4 @@ class Belongs_To extends Relationship {
return $this->base;
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment