Fix bugs in Eloquent.
This commit is contained in:
parent
28a880b5b5
commit
b0eb9a8b42
|
@ -711,10 +711,10 @@ public function __isset($key)
|
|||
{
|
||||
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)
|
||||
{
|
||||
unset($this->$source[$key]);
|
||||
unset($this->{$source}[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue