/** * 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); } }
public function __unset($name) { if ($this->hasState($name)) { $this->setState($name, null); } else { parent::__unset($name); } }
/** * Magic unset function. Removes a given attribute * * @param string $name */ public function __unset($name) { $name = str_replace('_', '', $name); parent::__unset($name); }