From f273f375927fef9f8774d471d98f90ffaaf486cd Mon Sep 17 00:00:00 2001 From: Ryan Deas Date: Wed, 4 Feb 2015 18:02:19 +0000 Subject: [PATCH] Fixed static magic method calls If a magic find is called such as first, __callStatic() will be called after __call() doesn't find any results and this will find the first magic method rather than an exception being thrown by __call() saying that the method doesn't exist. --- data/Model.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/data/Model.php b/data/Model.php index 9d09fe49ac..dd19193712 100644 --- a/data/Model.php +++ b/data/Model.php @@ -563,8 +563,7 @@ public function __call($method, $params) { if (isset($methods[$method]) && is_callable($methods[$method])) { return call_user_func_array($methods[$method], $params); } - $message = "Unhandled method call `{$method}`."; - throw new BadMethodCallException($message); + return self::__callStatic($method, $params); } /** @@ -1462,4 +1461,4 @@ public static function reset() { } } -?> \ No newline at end of file +?>