Exemple #1
0
 /**
  * Unsets property or item.
  *
  * @param string $name the property name or the event name
  */
 public function __unset($name)
 {
     if ($name && $this->canSetProperty($name)) {
         parent::__unset($name);
     } else {
         $this->unsetItem($name);
     }
 }
Exemple #2
0
 /**
  * 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 ($this->hasAttribute($name)) {
         unset($this->_attributes[$name]);
     } elseif (array_key_exists($name, $this->_related)) {
         unset($this->_related[$name]);
     } elseif ($this->getRelation($name, false) === null) {
         parent::__unset($name);
     }
 }
 /**
  * @inheritdoc
  */
 public function __unset($name)
 {
     if (array_key_exists($name, $this->_attributes)) {
         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
  */
 public function __unset($name)
 {
     if (!$this->setAttributeInternal($name, null)) {
         if (array_key_exists($name, $this->_related)) {
             unset($this->_related[$name]);
         } elseif ($this->getRelation($name, false) === null) {
             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 ($this->hasAttribute($name)) {
         unset($this->_attributes[$name]);
     } else {
         if (isset($this->_related[$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 ($this->hasAttribute($name)) {
         unset($this->_attributes[$name]);
     } elseif ($this->getRelation($name, false) === null) {
         parent::__unset($name);
     }
 }