当前位置: 首页>>代码示例>>PHP>>正文


PHP CFormModel::__get方法代码示例

本文整理汇总了PHP中CFormModel::__get方法的典型用法代码示例。如果您正苦于以下问题:PHP CFormModel::__get方法的具体用法?PHP CFormModel::__get怎么用?PHP CFormModel::__get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CFormModel的用法示例。


在下文中一共展示了CFormModel::__get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __get

 /**
  * Override to handle use case of $name == 'id'.
  * As this form does not have an 'id', it will return null;
  * @see ModelElement.  This form is used by ModelElement for example
  * and ModelElement expects the model to have an 'id' value.
  */
 public function __get($name)
 {
     if ($name == 'id') {
         return null;
     }
     return parent::__get($name);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:13,代码来源:ContactPrimaryEmailForm.php

示例2: __get

 public function __get($name)
 {
     if (Yii::app()->user->data->hasAttribute($name)) {
         return Yii::app()->user->data->{$name};
     }
     return parent::__get($name);
 }
开发者ID:Saltly,项目名称:SourceBans,代码行数:7,代码来源:AccountForm.php

示例3: __get

 public function __get($name)
 {
     if (isset($this->_data[$name])) {
         return $this->_data[$name];
     }
     return parent::__get($name);
 }
开发者ID:Saltly,项目名称:SourceBans,代码行数:7,代码来源:SettingsForm.php

示例4: __get

 public function __get($name)
 {
     if (isset($this->_properties[$name])) {
         return $this->_properties[$name];
     } else {
         return parent::__get($name);
     }
 }
开发者ID:schrapps,项目名称:risksur,代码行数:8,代码来源:DForm.php

示例5: __get

 public function __get($attribute)
 {
     if (in_array($attribute, array_keys($this->_fields))) {
         return $this->_fields[$attribute];
     } else {
         return parent::__get($attribute);
     }
 }
开发者ID:Telemedellin,项目名称:tm,代码行数:8,代码来源:CustomForm.php

示例6: __get

 public function __get($name)
 {
     if (isset($this->dynAttributes[$name])) {
         return $this->dynAttributes[$name];
     } else {
         return parent::__get($name);
     }
 }
开发者ID:rolandschaub,项目名称:roland-cms,代码行数:8,代码来源:list.php

示例7: __get

 public function __get($name)
 {
     if (isset($this->_params[$name])) {
         if (isset($this->_params[$name]['value'])) {
             return $this->_params[$name]['value'];
         }
         return isset($this->_params[$name]['default']) ? $this->_params[$name]['default'] : null;
     }
     return parent::__get($name);
 }
开发者ID:Cranky4,项目名称:npfs,代码行数:10,代码来源:PluginParameters.php

示例8: __get

 /**
  * A special getter to get 'value[0]' or 'value[str]' attributes and so on.
  * @see CComponent::__get()
  */
 public function __get($name)
 {
     if (($pos = strrpos($name, '[')) !== false) {
         $subname = substr($name, 0, $pos);
         $posn = strpos($name, ']', $pos);
         $value = $this->{$subname};
         return $value[substr($name, $pos + 1, $posn - $pos - 1)];
     }
     return parent::__get($name);
 }
开发者ID:anastaszor,项目名称:yiipluggable,代码行数:14,代码来源:PluggableFormModel.php

示例9: __get

 public function __get($name)
 {
     switch (true) {
         case isset($this->__tempVar[$name]):
             return $this->__tempVar;
             break;
         default:
             return parent::__get($name);
             break;
     }
 }
开发者ID:rizabudi,项目名称:plansys,代码行数:11,代码来源:Form.php

示例10: __get

 /**
  * Overload the __getter so that it checks for data in the following order
  * 1) Pull From db/cache (Cii::getConfig now does caching of elements for improved performance)
  * 2) Check for __protected__ property, which we consider the default vlaue
  * 3) parent::__get()
  *
  * In order for this to work with __default__ values, the properties in classes that extend from this
  * MUST be protected. If they are public it will bypass this behavior.
  * 
  * @param  mixed $name The variable name we want to retrieve from the calling class
  * @return mixed
  */
 public function __get($name)
 {
     $data = Cii::getConfig($name);
     if ($data !== NULL && $data !== "" && !isset($this->attributes[$name])) {
         return $data;
     }
     if (property_exists($this, $name)) {
         return $this->{$name};
     }
     return parent::__get($name);
 }
开发者ID:fandikurnia,项目名称:CiiMS,代码行数:23,代码来源:CiiSettingsModel.php

示例11: __get

 /**
  * __get
  * @param string $name
  * @return mixed|null|void
  */
 public function __get($name)
 {
     if (isset($this->_dynamicFields[$name])) {
         if (!empty($this->_dynamicData[$name])) {
             return $this->_dynamicData[$name];
         }
         return $this->_dynamicFields[$name];
     } else {
         return parent::__get($name);
     }
 }
开发者ID:schrapps,项目名称:risksur,代码行数:16,代码来源:DynamicFormDetails.php

示例12: __get

 public function __get($name)
 {
     try {
         parent::__get($name);
     } catch (CException $exception) {
         list($settingName, $type) = UserNotificationUtil::getSettingNameAndTypeBySuffixedConfigurationAttribute($name);
         if (isset($this->inboxAndEmailNotificationSettings[$settingName][$type])) {
             return $this->inboxAndEmailNotificationSettings[$settingName][$type];
         }
         return null;
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:12,代码来源:UserNotificationConfigurationForm.php

示例13: __get

 public function __get($name)
 {
     $module = Yii::app()->controller->module;
     switch ($name) {
         case $module->userIdColumn:
             return $this->_id;
         case $module->userNameColumn:
             return $this->_name;
         default:
             return parent::__get($name);
     }
 }
开发者ID:pvsaintpe,项目名称:yii-auth,代码行数:12,代码来源:UserFilterForm.php

示例14: __get

 public function __get($name)
 {
     $vars = get_class_vars(get_class($this));
     if (array_key_exists($name, $vars)) {
         return $this->{$name};
     } else {
         try {
             return parent::__get($name);
         } catch (Exception $e) {
             return null;
         }
     }
 }
开发者ID:uiDeveloper116,项目名称:webstore,代码行数:13,代码来源:ThemeForm.php

示例15: __get

 /**
  * PHP getter magic method.
  * This method is overridden so that any attribute can be accessed.
  * @param string $name the property name or event name
  * @return mixed the property value, event handlers attached to the event, or the named behavior
  * @throws CException if the property or event is not defined
  * @see __set
  */
 public function __get($name)
 {
     try {
         return parent::__get($name);
     } catch (Exception $e) {
         if (isset($this->_attributes[$name])) {
             return $this->_attributes[$name];
         }
         if (isset($_POST['YdActiveFormModel'][$name])) {
             return $this->_attributes[$name] = $_POST['YdActiveFormModel'][$name];
         }
         return null;
     }
 }
开发者ID:cornernote,项目名称:yii-embed-wordpress,代码行数:22,代码来源:YiiEmbedActiveFormModel.php


注:本文中的CFormModel::__get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。