當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ActiveRecord::__get方法代碼示例

本文整理匯總了PHP中yii\db\ActiveRecord::__get方法的典型用法代碼示例。如果您正苦於以下問題:PHP ActiveRecord::__get方法的具體用法?PHP ActiveRecord::__get怎麽用?PHP ActiveRecord::__get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在yii\db\ActiveRecord的用法示例。


在下文中一共展示了ActiveRecord::__get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _getValue

 /**
  * @inheritDoc
  */
 protected function _getValue(ActiveRecord $model)
 {
     if ($model instanceof ActiveRecord) {
         /** @var ActiveRecord $model */
         return $model->__get($this->attributeName);
     }
 }
開發者ID:nanodesu88,項目名稱:easyii,代碼行數:10,代碼來源:ActiveDataColumn.php

示例2: __get

 public function __get($name)
 {
     if (isset($this->_pivotAttributes[$name])) {
         return $this->_pivotAttributes[$name];
     }
     return parent::__get($name);
 }
開發者ID:alexinator1,項目名稱:yii2-jta,代碼行數:7,代碼來源:ActiveRecord.php

示例3: __get

 public function __get($name)
 {
     if ($name === 'history') {
         return $this->getHistory();
     }
     return parent::__get($name);
 }
開發者ID:serhiobb,項目名稱:RGK-test,代碼行數:7,代碼來源:Url.php

示例4: __get

 public function __get($name)
 {
     if ($name == 'display_type') {
         return $this->getDisplayType();
     } else {
         return parent::__get($name);
     }
 }
開發者ID:shkrad,項目名稱:my_music_storage,代碼行數:8,代碼來源:Release.php

示例5: __get

 public function __get($name)
 {
     if (in_array($name, $this->jsonParams)) {
         return $this->getJsonParams($name);
     } else {
         return parent::__get($name);
     }
 }
開發者ID:worstinme,項目名稱:yii2-z-cart,代碼行數:8,代碼來源:CartOrders.php

示例6: __get

 /**
  * Override __get of yii\db\ActiveRecord
  *
  * @param string $name the property name
  * @return mixed
  */
 public function __get($name)
 {
     if ($this->hasAttribute($name)) {
         return parent::__get($name);
     } else {
         return $this->getMetaAttribute($name);
     }
 }
開發者ID:mipotech,項目名稱:yii2-meta-activerecord,代碼行數:14,代碼來源:MetaActiveRecord.php

示例7: __get

 /**
  * @param string $field
  *
  * @return mixed|void
  */
 public function __get($field)
 {
     if (in_array($field, $this->getMultiLangFields())) {
         $language = \Yii::$app->language;
         $field = $this->buildMultilangFieldName($field, $language);
     }
     return parent::__get($field);
 }
開發者ID:pbabilas,項目名稱:bcode,代碼行數:13,代碼來源:AbstractMultiLangModel.php

示例8: __get

 public function __get($name)
 {
     if (!in_array($name, $this->attributes()) && !empty($this->app->elements[$name]) && ($behavior = $this->getBehavior($this->app->elements[$name]->type)) !== null) {
         return $behavior->getValue($name);
     } else {
         return parent::__get($name);
     }
 }
開發者ID:worstinme,項目名稱:yii2-zoo,代碼行數:8,代碼來源:Items.php

示例9: __get

 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     if ($this->_schema && isset($this->_schema[$name])) {
         if (array_key_exists($name, $this->_values)) {
             return $this->_values[$name];
         } else {
             return null;
         }
     }
     return parent::__get($name);
 }
開發者ID:sangkil,項目名稱:application,代碼行數:14,代碼來源:GlobalConfig.php

示例10: __get

 public function __get($name)
 {
     try {
         return parent::__get($name);
     } catch (UnknownPropertyException $e) {
         if (isset($this->_transformers[$name])) {
             return $this->_transformers[$name]->transformFrom();
         }
         return parent::__get(static::prop2col($name));
     }
 }
開發者ID:tsyrya,項目名稱:mybriop,代碼行數:11,代碼來源:EntityBase.php

示例11: __get

 public function __get($name)
 {
     if (in_array($name, $this->getDefaultFields())) {
         return parent::__get($name);
     }
     if (in_array($name, $this->getSkipFields())) {
         $rules = Json::decode($this->rules);
         if (isset($rules[$name])) {
             return $rules[$name];
         }
     }
     return [];
 }
開發者ID:mirocow,項目名稱:yii2-eav,代碼行數:13,代碼來源:EavAttributeRule.php

示例12: __get

 /**
  * @return mixed
  */
 public function __get($name)
 {
     // if the attribute is defined as a meta-attribute, fetch it
     // otherwise let the parent class handle the request
     if ($this->hasMetaAttribute($name)) {
         return $this->getMeta($name);
     } else {
         if (($val = ArrayHelper::getValue($this, $name)) !== null) {
             return $val;
         } else {
             return parent::__get($name);
         }
     }
 }
開發者ID:NewPaltzKarateAcademy,項目名稱:KIMS,代碼行數:17,代碼來源:MetaModel.php

示例13: issetAttribute

 /**
  * Returns if a model attribute is set.
  *
  * @param string $name attribute name, use dotted notation for structured attributes.
  *
  * @return bool true if the attribute is set
  */
 public function issetAttribute($name)
 {
     try {
         if (parent::__get($name) !== null) {
             return true;
         }
     } catch (Exception $ignore) {
     }
     $path = explode('.', $name);
     $ref =& $this->_dynamicAttributes;
     foreach ($path as $key) {
         if (!isset($ref[$key])) {
             return false;
         }
         $ref =& $ref[$key];
     }
     return true;
 }
開發者ID:nineinchnick,項目名稱:yii2-dynamic-ar,代碼行數:25,代碼來源:DynamicActiveRecord.php

示例14: __get

 public function __get($key)
 {
     if ($key = $this->hasKey($key)) {
         return parent::__get($key);
     }
 }
開發者ID:JiltImageBoard,項目名稱:jilt-backend,代碼行數:6,代碼來源:ARExtended.php

示例15: __get

 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     return $name === 'name' ? $this->name() : parent::__get($name);
 }
開發者ID:yii2-tools,項目名稱:yii2-active-params,代碼行數:7,代碼來源:ActiveParam.php


注:本文中的yii\db\ActiveRecord::__get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。