Fix bugs in Eloquent.

This commit is contained in:
Taylor Otwell 2013-01-05 16:45:34 -06:00
parent 28a880b5b5
commit b0eb9a8b42
1 changed files with 3 additions and 3 deletions

View File

@ -711,10 +711,10 @@ public function __isset($key)
{ {
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 @@ public function __unset($key)
{ {
foreach (array('attributes', 'relationships') as $source) foreach (array('attributes', 'relationships') as $source)
{ {
unset($this->$source[$key]); unset($this->{$source}[$key]);
} }
} }