/** * Whether this AR has the named attribute (table column or class property) * and it is not disallowed by config * (params.php 'modelAttributes', {@link MParams::getModelAttributes}). * @param string attribute name * @return boolean */ public function hasVirtualAttribute($name) { return ($this->hasAttribute($name) || property_exists(get_class($this), $name)) && MParams::getModelAttributes(get_class($this), $name) !== false; }