Skip to content

Commit

Permalink
stop making isset so complicated
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed May 31, 2016
1 parent ec0d6e0 commit 8fb89c6
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -3466,15 +3466,7 @@ public function offsetUnset($offset)
*/
public function __isset($key)
{
if (isset($this->attributes[$key]) || isset($this->relations[$key])) {
return true;
}

if (method_exists($this, $key) && $this->$key && isset($this->relations[$key])) {
return true;
}

return $this->hasGetMutator($key) && ! is_null($this->getAttributeValue($key));
return ! is_null($this->getAttribute($key));
}

/**
Expand Down

0 comments on commit 8fb89c6

Please sign in to comment.