From b0eb9a8b42c81ebbebda4636aa22634de71ab1cf Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 5 Jan 2013 16:45:34 -0600 Subject: [PATCH] Fix bugs in Eloquent. --- laravel/database/eloquent/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index 433c25ff..cb555de4 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -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]); } }