Exemplo n.º 1
0
 public function __unset($key)
 {
     if ($key = $this->hasKey($key)) {
         parent::__unset($key);
     }
 }
 /**
  * Unset a model attribute.
  *
  * @param string $name attribute name, use dotted notation for structured attributes.
  */
 public function unsetAttribute($name)
 {
     try {
         parent::__unset($name);
     } catch (\Exception $ignore) {
     }
     if ($this->issetAttribute($name)) {
         $this->setAttribute($name, null);
     }
 }
Exemplo n.º 3
0
 public function __unset($name)
 {
     try {
         parent::__unset($name);
     } catch (InvalidCallException $e) {
         if (isset($this->_transformers[$name])) {
             unset($this->_transformers[$name]);
         } else {
             parent::__unset(static::prop2col($name));
         }
         //todo: May be change this behaviour?
     }
 }