From 67caa68e44264b439370f34ececff33f54e2aeb9 Mon Sep 17 00:00:00 2001 From: Nurlan Mukhanov <102@mp.kz> Date: Wed, 9 Jun 2021 16:57:22 +0600 Subject: [PATCH] fix --- src/DBD/Entity/Entity.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/DBD/Entity/Entity.php b/src/DBD/Entity/Entity.php index 9167939..467724b 100644 --- a/src/DBD/Entity/Entity.php +++ b/src/DBD/Entity/Entity.php @@ -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(); } }