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