Commit b0eb9a8b authored by Taylor Otwell's avatar Taylor Otwell

Fix bugs in Eloquent.

parent 28a880b5
...@@ -711,10 +711,10 @@ abstract class Model { ...@@ -711,10 +711,10 @@ abstract class Model {
{ {
foreach (array('attributes', 'relationships') as $source) foreach (array('attributes', 'relationships') as $source)
{ {
if (array_key_exists($key, $this->$source)) return true; if (array_key_exists($key, $this->{$source})) return ! empty($this->{$source}[$key]);
} }
if (method_exists($this, $key)) return true; return false;
} }
/** /**
...@@ -727,7 +727,7 @@ abstract class Model { ...@@ -727,7 +727,7 @@ abstract class Model {
{ {
foreach (array('attributes', 'relationships') as $source) foreach (array('attributes', 'relationships') as $source)
{ {
unset($this->$source[$key]); unset($this->{$source}[$key]);
} }
} }
......
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