Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Falseclock committed Jun 9, 2021
1 parent 726f6df commit 67caa68
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/DBD/Entity/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,12 @@ public function __get(string $methodName)
$lookupMethod = ucfirst($methodName);
}

/** @noinspection PhpUnnecessaryCurlyVarSyntaxInspection */
if (!method_exists($this, "get{$lookupMethod}")) {
$lookupMethod = "get" . $lookupMethod;

if (!method_exists($this, $lookupMethod)) {
throw new EntityException(sprintf("Can't find property or getter method for '\$%s' of '%s'", $methodName, get_class($this)));
}

return $this->$methodName();
return $this->$lookupMethod();
}
}

0 comments on commit 67caa68

Please sign in to comment.