hasAttribute($name)) { $getter = 'get' . $name; if (method_exists($this, $getter)) { // read property, e.g. getName() return $this->$getter(); } return null; } return parent::__get($name); } public function arrayValidate($attribute, $params) { if (!is_array($this->$attribute)) { $this->addError($attribute, 'Неверный формат "'.$attribute.'"'); } } }