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


PHP Model::__get方法代碼示例

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


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

示例1: __get

 public function __get($name)
 {
     if (stripos($name, 'attr') === 0) {
         return isset($this->attr[$name]) ? $this->attr[$name] : null;
     }
     return parent::__get($name);
 }
開發者ID:howq,項目名稱:yii2,代碼行數:7,代碼來源:FakedValidationModel.php

示例2: __get

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

示例3: __get

 /**
  * @param string $name
  * @return mixed
  * @throws \yii\base\UnknownPropertyException
  */
 public function __get($name)
 {
     if (parent::hasProperty($name)) {
         return parent::__get($name);
     }
     return $this->db->{$name};
 }
開發者ID:gangbo,項目名稱:yii2-dbschema,代碼行數:12,代碼來源:DbCollection.php

示例4: __get

 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     if (isset($this->attrStorage[$name])) {
         return $this->attrStorage[$name];
     }
     return parent::__get($name);
 }
開發者ID:Razzwan,項目名稱:dotplant2,代碼行數:10,代碼來源:Yml.php

示例5: __get

 /**
  * @param string $name
  * @return mixed
  * @throws \yii\base\UnknownPropertyException
  */
 public function __get($name)
 {
     if (array_key_exists($name, $this->apiData)) {
         return ArrayHelper::getValue($this->apiData, $name);
     }
     return parent::__get($name);
 }
開發者ID:Liv1020,項目名稱:cms,代碼行數:12,代碼來源:PackageModel.php

示例6: __get

 public function __get($name)
 {
     if (!isset($this->{$name})) {
         return false;
     }
     parent::__get($name);
 }
開發者ID:rocketyang,項目名稱:mincms,代碼行數:7,代碼來源:NodeActiveRecord.php

示例7: __get

 /**
  * This method is overridden to support accessing items like properties.
  *
  * @param string $name component or property name
  *
  * @return mixed item of found or the named property value
  */
 public function __get($name)
 {
     if ($name && $this->canGetProperty($name)) {
         return parent::__get($name);
     } else {
         return $this->getItem($name);
     }
 }
開發者ID:heartshare,項目名稱:yii2-collection,代碼行數:15,代碼來源:Model.php

示例8: __get

 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     if (array_key_exists($name, $this->_attributes)) {
         return $this->_attributes[$name];
     } else {
         return parent::__get($name);
     }
 }
開發者ID:diandianxiyu,項目名稱:Yii2Api,代碼行數:11,代碼來源:DynamicModel.php

示例9: __get

 /**
  * @param string $name
  * @return mixed
  * @throws \yii\base\UnknownPropertyException
  */
 public function __get($name)
 {
     if (key_exists($name, $this->_attributes)) {
         $result = $this->_attributes[$name];
     } else {
         $result = parent::__get($name);
     }
     return $result;
 }
開發者ID:fgh151,項目名稱:yii2-params,代碼行數:14,代碼來源:ParamsModel.php

示例10: __get

 /**
  * @inheritdoc
  */
 public function __get($name)
 {
     if (isset($this->attrStorage[$name])) {
         return $this->attrStorage[$name];
     }
     if (in_array($name, $this->attributes())) {
         return '';
     }
     return parent::__get($name);
 }
開發者ID:tqsq2005,項目名稱:dotplant2,代碼行數:13,代碼來源:Yml.php

示例11: __get

 public function __get($name)
 {
     if (in_array($name, ['creditCard_number', 'creditCard_expirationDate', 'creditCard_cvv'])) {
         if (!isset($this->_attributes[$name])) {
             $this->_attributes[$name] = null;
         }
         return $this->_attributes[$name];
     }
     return parent::__get($name);
 }
開發者ID:andrewblake1,項目名稱:yii2-credit-card,代碼行數:10,代碼來源:CreditCard.php

示例12: __get

 /**
  * @param string $name
  * @return $this|mixed
  * @throws \yii\base\UnknownPropertyException
  */
 public function __get($name)
 {
     if (isset($this->_attributes[$name])) {
         return $this->_attributes[$name];
     }
     $_name = explode('.', $name);
     if (count($_name) == 2) {
         return Settings::value($_name[0], $_name[1]);
     }
     return parent::__get($name);
 }
開發者ID:vetoni,項目名稱:toko,代碼行數:16,代碼來源:SettingsBase.php

示例13: __get

 public function __get($name)
 {
     if (array_key_exists($name, array_flip($this->extraAttributes))) {
         if (isset($this->extraAttributesData[$name])) {
             return $this->extraAttributesData[$name];
         } else {
             return null;
         }
     }
     return parent::__get($name);
 }
開發者ID:gogl92,項目名稱:yii2-teleduino,代碼行數:11,代碼來源:Request.php

示例14: __get

 public function __get($name)
 {
     if (isset($this->models[$name])) {
         return $this->models[$name];
     }
     foreach ($this->models as $model) {
         if ($model->hasAttribute($name)) {
             return $model->getAttribute($name);
         }
     }
     return parent::__get($name);
 }
開發者ID:yinheark,項目名稱:yincart2,代碼行數:12,代碼來源:FormModel.php

示例15: __get

 /**
  * @brief 獲取屬性名稱
  *
  * @return  public function 
  * @retval   
  * @see 
  * @note 
  * @author 呂寶貴
  * @date 2016/03/07 15:49:24
  **/
 public function __get($name)
 {
     if (isset($this->_attributes[$name]) || array_key_exists($name, $this->_attributes)) {
         return $this->_attributes[$name];
     } elseif ($this->hasAttribute($name)) {
         return null;
     } else {
         if (isset($this->_related[$name]) || array_key_exists($name, $this->_related)) {
             return $this->_related[$name];
         }
         $value = parent::__get($name);
         return $value;
     }
 }
開發者ID:lubaogui,項目名稱:yii2-payment,代碼行數:24,代碼來源:PayBase.php


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