当前位置: 首页>>代码示例>>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;未经允许,请勿转载。