Skip to content

Commit b0eb9a8

Browse files
committed
Fix bugs in Eloquent.
1 parent 28a880b commit b0eb9a8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

laravel/database/eloquent/model.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,10 +711,10 @@ public function __isset($key)
711711
{
712712
foreach (array('attributes', 'relationships') as $source)
713713
{
714-
if (array_key_exists($key, $this->$source)) return true;
714+
if (array_key_exists($key, $this->{$source})) return ! empty($this->{$source}[$key]);
715715
}
716716

717-
if (method_exists($this, $key)) return true;
717+
return false;
718718
}
719719

720720
/**
@@ -727,7 +727,7 @@ public function __unset($key)
727727
{
728728
foreach (array('attributes', 'relationships') as $source)
729729
{
730-
unset($this->$source[$key]);
730+
unset($this->{$source}[$key]);
731731
}
732732
}
733733

0 commit comments

Comments
 (0)