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

This commit is contained in:
Franz Liedke 2012-06-29 20:56:32 +03:00
parent 603e349de9
commit a87bb86999
1 changed files with 1 additions and 1 deletions

View File

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