Skip to content

Commit

Permalink
Merge pull request #4819 from MGatner/magic-model
Browse files Browse the repository at this point in the history
Revert Model coalesce
  • Loading branch information
MGatner authored Jun 10, 2021
2 parents 4f42d4b + f494f77 commit 2198dd0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion system/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,17 @@ protected function objectToRawArray($data, bool $onlyChanged = true, bool $recur
*/
public function __get(string $name)
{
return parent::__get($name) ?? $this->builder()->$name ?? null;
if (parent::__isset($name))
{
return parent::__get($name);
}

if (isset($this->builder()->$name))
{
return $this->builder()->$name;
}

return null;
}

/**
Expand Down

0 comments on commit 2198dd0

Please sign in to comment.