当前位置: 首页>>代码示例>>PHP>>正文


PHP CActiveRecord::__get方法代码示例

本文整理汇总了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);
 }
开发者ID:black2279,项目名称:Tracy-openshift,代码行数:7,代码来源:Source.php

示例2: __get

 public function __get($name)
 {
     if (array_key_exists($name, $this->_langAttributes)) {
         return $this->_langAttributes[$name];
     } else {
         return parent::__get($name);
     }
 }
开发者ID:jasonhai,项目名称:onehome,代码行数:8,代码来源:MultilingualActiveRecord.php

示例3: __get

 public function __get($name)
 {
     if (isset($this->_fieldsArias[$name])) {
         return parent::__get($this->_fieldsArias[$name]);
     } else {
         return parent::__get($name);
     }
 }
开发者ID:zwq,项目名称:unpei,代码行数:8,代码来源:TActiveRecord.php

示例4: __get

 public function __get($name)
 {
     if ($name == $this->getAttribute('id_attr')) {
         return $this->value;
     } else {
         return parent::__get($name);
     }
 }
开发者ID:fobihz,项目名称:cndiesel,代码行数:8,代码来源:AttrVal.php

示例5: __get

 public function __get($name)
 {
     if ($name == 'survey') {
         $relationModelClassName = $this->surveyLocation;
         return $relationModelClassName::model()->findByPk($this->surveyId);
     }
     return parent::__get($name);
 }
开发者ID:shnellpavel,项目名称:bcgroup_lk,代码行数:8,代码来源:SurveyUser.php

示例6: __get

 public function __get($name)
 {
     $getter = 'get' . $name;
     if (method_exists($this, $getter)) {
         return $this->{$getter}();
     }
     return parent::__get($name);
 }
开发者ID:paranoidxc,项目名称:iwebhost,代码行数:8,代码来源:Attachment.php

示例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);
     }
 }
开发者ID:Renbaozhan,项目名称:ecar,代码行数:12,代码来源:RActiveRecord.php

示例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);
     }
 }
开发者ID:nurirahmat,项目名称:Yii-Extensions,代码行数:9,代码来源:ActiveRecord.php

示例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;
 }
开发者ID:sam-it,项目名称:yii1-translate,代码行数:12,代码来源:Translation.php

示例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);
     }
 }
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:13,代码来源:ActiveRecord.php

示例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());
         }
     }
 }
开发者ID:nizsheanez,项目名称:alp.ru,代码行数:14,代码来源:ActiveRecordModel.php

示例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);
 }
开发者ID:laiello,项目名称:flexiblearning,代码行数:15,代码来源:Base.php

示例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;
         }
     }
 }
开发者ID:kuzmina-mariya,项目名称:unizaro-spa,代码行数:15,代码来源:EavActiveRecord.php

示例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());
         }
     }
 }
开发者ID:blindest,项目名称:Yii-CMS-2.0,代码行数:18,代码来源:ActiveRecord.php

示例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);
         }
     }
 }
开发者ID:nizsheanez,项目名称:documentation,代码行数:18,代码来源:ActiveRecordModel.php


注:本文中的CActiveRecord::__get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。