Skip to content

Commit

Permalink
Remoção de concatenações
Browse files Browse the repository at this point in the history
  • Loading branch information
robsonvleite committed Jul 2, 2020
1 parent 88725a2 commit 6a51fa2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions example/find_example.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
$user = $model->findById(20);
var_dump($user->data());

var_dump($user->first_name);
echo "<h1>{$user->full_name}</h1>";

/**
Expand Down
4 changes: 4 additions & 0 deletions src/DataLayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ public function __get($name)
return $this->$method();
}

if (method_exists($this, $name)) {
return $this->$name();
}

return ($this->data->$name ?? null);
}

Expand Down

0 comments on commit 6a51fa2

Please sign in to comment.