diff --git a/system/Abstracts/Component.php b/system/Abstracts/Component.php index 4e72e356..f7d02032 100644 --- a/system/Abstracts/Component.php +++ b/system/Abstracts/Component.php @@ -130,6 +130,21 @@ class Component extends BaseObject } + /** + * @param $name + * @param $value + * @throws Exception + */ + public function __set($name, $value) + { + if (property_exists($this, $name)) { + $this->$name = $value; + } else { + parent::__set($name, $value); + } + } + + /** * @param $name * @return mixed @@ -137,10 +152,7 @@ class Component extends BaseObject */ public function __get($name) { - $method = 'get' . ucfirst($name); - if (method_exists($this, $method)) { - return $this->$method(); - } else if (property_exists($this, $name)) { + if (property_exists($this, $name)) { return $this->$name ?? null; } else { return parent::__get($name);