/**
  * 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);
 }
示例#2
0
 public function __get($name)
 {
     if (Yii::app()->user->data->hasAttribute($name)) {
         return Yii::app()->user->data->{$name};
     }
     return parent::__get($name);
 }
示例#3
0
 public function __get($name)
 {
     if (isset($this->_data[$name])) {
         return $this->_data[$name];
     }
     return parent::__get($name);
 }
示例#4
0
 public function __get($name)
 {
     if (isset($this->_properties[$name])) {
         return $this->_properties[$name];
     } else {
         return parent::__get($name);
     }
 }
示例#5
0
 public function __get($attribute)
 {
     if (in_array($attribute, array_keys($this->_fields))) {
         return $this->_fields[$attribute];
     } else {
         return parent::__get($attribute);
     }
 }
示例#6
0
 public function __get($name)
 {
     if (isset($this->dynAttributes[$name])) {
         return $this->dynAttributes[$name];
     } else {
         return parent::__get($name);
     }
 }
示例#7
0
 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);
 }
 /**
  * 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);
 }
示例#9
0
文件: Form.php 项目: rizabudi/plansys
 public function __get($name)
 {
     switch (true) {
         case isset($this->__tempVar[$name]):
             return $this->__tempVar;
             break;
         default:
             return parent::__get($name);
             break;
     }
 }
示例#10
0
 /**
  * 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);
 }
示例#11
0
 /**
  * __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);
     }
 }
 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;
     }
 }
示例#13
0
 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);
     }
 }
示例#14
0
 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;
         }
     }
 }
 /**
  * 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;
     }
 }
示例#16
0
 public function __get($name) {
     if (isset($this->_config[$name]))
         return $this->_config[$name];
     else
         return parent::__get($name);
 }
 public function __get($name)
 {
     if (isset($this->_values[$name])) {
         return $this->_values[$name][0];
     }
     return parent::__get($name);
 }
示例#18
0
 /**
  * Returns a property value or an event handler list by property or event name.
  * This method overrides the parent implementation by returning
  * a key value if the key exists in the collection.
  * @param string $name the property name or the event name
  * @return mixed the property value or the event handler list
  * @throws CException if the property/event is not defined.
  */
 public function __get($name)
 {
     if ($this->_attributes->contains($name)) {
         return $this->_attributes->itemAt($name);
     } else {
         return parent::__get($name);
     }
 }