示例#1
0
 /**
  * PHP setter magic method.
  * This method is overridden so that config keys can be accessed like properties.
  * @param string $name property name
  * @param mixed $value property value
  * @return mixed
  */
 public function __set($name, $value)
 {
     if ($name != 'configs' && $this->setConfig($name, $value) !== false) {
         return true;
     }
     return parent::__set($name, $value);
 }
示例#2
0
 /**
  * PHP unset magic method.
  * This is a PHP magic method that we override to allow using unset() to set a config key to be null.
  *
  * @param string $name the property name or the event name
  * @return mixed
  */
 public function __unset($name)
 {
     if (isset($this->_configs[$name])) {
         $this->setConfig($name, null);
     } else {
         parent::__unset($name);
     }
 }