public function __unset($name) { if (in_array($name, $this->attributeNames())) { unset($this->_attributes[$name]); } else { parent::__unset($name); } }
/** * (non-PHPdoc) * @see CComponent::__unset() */ public function __unset($name) { if (isset($this->_attributes[$name])) { unset($this->_attributes[$name]); } elseif (isset($this->_related[$name])) { unset($this->_related[$name]); } else { parent::__unset($name); } }
public function __unset($name) { if (isset($this->getMetaData()->columns[$name])) { unset($this->_attributes[$name]); } elseif (isset($this->getMetaData()->relations[$name])) { unset($this->_related[$name]); } else { parent::__unset($name); } }
/** * Sets a component property to be null. * This method overrides the parent implementation by clearing * the specified attribute value. * @param string $name the property name or the event name */ public function __unset($name) { if (isset($this->getMetaData()->properties[$name])) { unset($this->_attributes[$name]); } else { parent::__unset($name); } }
/** * Sets a component property to be null. * This method overrides the parent implementation by clearing * the specified attribute value. * @param string $name the property name or the event name * * @return void */ public function __unset($name) { if ($this->getResourceSchema()->hasAttribute($name)) { unset($this->_attributes[$name]); } elseif (isset($this->_links[$name])) { unset($this->_linked[$name]); } else { parent::__unset($name); } }
/** * 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) { if (array_key_exists($name, $this->_attributes)) { unset($this->_attributes[$name]); } else { parent::__unset($name); } }