예제 #1
0
 /**
  * Sets a component property to be null.
  * Do not call this method. This is a PHP magic method that we override
  * to allow using unset() to set a component property to be null.
  * @param string $name the property name or the event name
  * @throws CException if the property is read only.
  * @return mixed
  */
 public function __unset($name)
 {
     $setter = 'set' . $name;
     if (property_exists($this->getClient(), $name)) {
         $this->getClient()->{$name} = null;
     } elseif (method_exists($this, $setter)) {
         $this->{$setter}(null);
     } else {
         parent::__unset($name);
     }
 }
예제 #2
0
 public function __unset($name)
 {
     if ($this->hasState($name)) {
         $this->setState($name, null);
     } else {
         parent::__unset($name);
     }
 }
예제 #3
0
파일: GeoCoder.php 프로젝트: mafiu/listapp
 /**
  * Magic unset function. Removes a given attribute
  *
  * @param string $name
  */
 public function __unset($name)
 {
     $name = str_replace('_', '', $name);
     parent::__unset($name);
 }