Browse Source

Fix a bug with Eloquent model classes and isset() when eager loading a relationship returns an empty result set.

Franz Liedke 12 years ago
parent
commit
a87bb86999
1 changed files with 1 additions and 1 deletions
  1. 1 1
      laravel/database/eloquent/model.php

+ 1 - 1
laravel/database/eloquent/model.php

@@ -725,7 +725,7 @@ 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 !is_null($this->$source[$key]);
 		}
 		}
 		
 		
 		if (method_exists($this, $key)) return true;
 		if (method_exists($this, $key)) return true;