function __get($key) { if ($key == "id") { return $this->user_id; } return ActiveRecord::__get($key); }
public function __get($name) { try { return parent::__get($name); } catch (Exception $e) { } }
public function __get($name) { if (in_array($name, $this->i18n())) { $attr = Yii::app()->language . '_' . $name; return $this->{$attr}; } else { return parent::__get($name); } }
/** * PHP getter magic method. * This method is overridden so that AR attributes can be accessed like properties. * @param string $name property name * @return mixed property value * @see getAttribute */ public function __get($name) { if ($this->_isMultilingualAttribute($name) && !$this->isNew) { $this->_loadMultilingualAttribute($name); } return parent::__get($name); }
/** * Allows to access EAV attributes like normal model attrs. * e.g $model->eav_some_attribute_name * * @todo Optimize, cache. * @param $name * @return null */ public function __get($name) { if (substr($name, 0, 4) === 'eav_') { if ($this->getIsNewRecord()) { return null; } $attribute = substr($name, 4); $eavData = $this->getEavAttributes(); if (isset($eavData[$attribute])) { $value = $eavData[$attribute]; } else { return null; } $attributeModel = ShopAttribute::model()->findByAttributes(array('name' => $attribute)); return $attributeModel->renderValue($value); } return parent::__get($name); }
public function __get($name) { if ($name == "title") { return $this->languageSettings[0]->surveyls_title; } elseif ($name == "id") { return $this->sid; } return parent::__get($name); }