From bba9ce0202dc51c43bd366a812fcdf24ee70330e Mon Sep 17 00:00:00 2001 From: hpaul Date: Sat, 5 May 2012 16:19:24 +0300 Subject: [PATCH] fixed #1 --- model.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/model.php b/model.php index 1321fef..4042558 100644 --- a/model.php +++ b/model.php @@ -411,6 +411,7 @@ public function __call($method, $parameters) { return call_user_func_array(array($this, '_' . $method), $parameters); } + throw new \Exception("Method [$method] is not defined."); } /** @@ -436,9 +437,9 @@ public function __set($key, $value) */ public static function __callStatic($method, $parameters) { - $model = new static; + $model = get_called_class(); - return call_user_func_array(array($model, '_' . $method), $parameters); + return call_user_func_array(array(new $model, $method), $parameters); } } \ No newline at end of file