本文整理汇总了PHP中CActiveRecord::__get方法的典型用法代码示例。如果您正苦于以下问题:PHP CActiveRecord::__get方法的具体用法?PHP CActiveRecord::__get怎么用?PHP CActiveRecord::__get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CActiveRecord
的用法示例。
在下文中一共展示了CActiveRecord::__get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function __get($name)
{
if ($name == 'description') {
return $this->description();
}
return parent::__get($name);
}
示例2: __get
public function __get($name)
{
if (array_key_exists($name, $this->_langAttributes)) {
return $this->_langAttributes[$name];
} else {
return parent::__get($name);
}
}
示例3: __get
public function __get($name)
{
if (isset($this->_fieldsArias[$name])) {
return parent::__get($this->_fieldsArias[$name]);
} else {
return parent::__get($name);
}
}
示例4: __get
public function __get($name)
{
if ($name == $this->getAttribute('id_attr')) {
return $this->value;
} else {
return parent::__get($name);
}
}
示例5: __get
public function __get($name)
{
if ($name == 'survey') {
$relationModelClassName = $this->surveyLocation;
return $relationModelClassName::model()->findByPk($this->surveyId);
}
return parent::__get($name);
}
示例6: __get
public function __get($name)
{
$getter = 'get' . $name;
if (method_exists($this, $getter)) {
return $this->{$getter}();
}
return parent::__get($name);
}
示例7: __get
/**
* 复杂类型字段读取实现
*/
public function __get($name)
{
if (in_array($name, $this->complexAttributes())) {
$value = parent::__get($name);
return CJSON::decode($value);
} else {
return parent::__get($name);
}
}
示例8: __get
public function __get($name)
{
$upper = strtoupper($name);
if ($this->hasAttribute($upper) || $this->hasRelated($upper)) {
return parent::__get($upper);
} else {
return parent::__get($name);
}
}
示例9: __get
public function __get($name)
{
try {
return parent::__get($name);
} catch (\Exception $ex) {
$e = $ex;
}
if (array_key_exists($name, $this->dataStore)) {
return $this->dataStore[$name];
}
throw $e;
}
示例10: __get
public function __get($name)
{
try {
return parent::__get($name);
} catch (Exception $e) {
$error = $e->getMessage();
$msg = 'Failed to retrieve a required property ("' . $name . '"): ' . $error . '<br/>This can be due to an outdated database.<br/>';
if (!Yii::app()->controller instanceof InstallController) {
$msg .= '<br/>Please run the ' . CHtml::link('control panel installer', Yii::app()->request->getBaseUrl(true) . '/install.php') . ' to fix this issue.<br/>';
}
throw new RawHttpException(500, $msg);
}
}
示例11: __get
public function __get($name)
{
try {
return parent::__get($name);
} catch (CException $e) {
$method_name = StringHelper::underscoreToCamelcase($name);
$method_name = 'get' . ucfirst($method_name);
if (method_exists($this, $method_name)) {
return $this->{$method_name}();
} else {
throw new CException($e->getMessage());
}
}
}
示例12: __get
public function __get($name)
{
$lang = Yii::app()->getLanguage();
$att = $name . '_' . $lang;
if ($this->hasAttribute($att)) {
$value = parent::__get($att);
if (!$value) {
$defaultLang = Yii::app()->params['defaultLanguage'];
return parent::__get($name . '_' . $defaultLang);
} else {
return $value;
}
}
return parent::__get($name);
}
示例13: __get
public function __get($name)
{
if (!$this->eavEnable) {
return parent::__get($name);
}
try {
return parent::__get($name);
} catch (CException $ex) {
if ($this->hasEavAttribute($name)) {
return $this->getEavAttribute($name);
} else {
throw $ex;
}
}
}
示例14: __get
public function __get($name)
{
try {
return parent::__get($name);
} catch (CException $e) {
if (substr($name, -6) == '_label') {
$attribute = substr($name, 0, -6);
return $this->getAttributeLabel($attribute);
}
$method_name = Yii::app()->text->underscoreToCamelcase($name);
$method_name = 'get' . ucfirst($method_name);
if (method_exists($this, $method_name)) {
return $this->{$method_name}();
} else {
throw new CException($e->getMessage());
}
}
}
示例15: __get
public function __get($name)
{
try {
return parent::__get($name);
} catch (CException $e) {
$method_name = StringHelper::underscoreToCamelcase($name);
if (method_exists($this, 'get' . ucfirst($method_name))) {
return $this->{$method_name};
} else {
$attr = StringHelper::camelCaseToUnderscore($name);
if (mb_substr($attr, 0, 4) == 'get_') {
$attr = mb_substr($attr, 4);
}
$attr = get_class($this) . '.' . $attr;
throw new CException('Не определено свойство ' . $attr);
}
}
}