diff --git a/framework/yii/base/Component.php b/framework/yii/base/Component.php index a7ddd29..f497a29 100644 --- a/framework/yii/base/Component.php +++ b/framework/yii/base/Component.php @@ -193,9 +193,8 @@ class Component extends Object */ public function __call($name, $params) { - $getter = 'get' . $name; - if (method_exists($this, $getter)) { - $func = $this->$getter(); + if ($this->canGetProperty($name)) { + $func = $this->$name; if ($func instanceof \Closure) { return call_user_func_array($func, $params); } diff --git a/framework/yii/base/Object.php b/framework/yii/base/Object.php index adbab9c..0af3131 100644 --- a/framework/yii/base/Object.php +++ b/framework/yii/base/Object.php @@ -155,9 +155,8 @@ class Object implements Arrayable */ public function __call($name, $params) { - $getter = 'get' . $name; - if (method_exists($this, $getter)) { - $func = $this->$getter(); + if ($this->canGetProperty($name)) { + $func = $this->$name; if ($func instanceof \Closure) { return call_user_func_array($func, $params); }