當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。