Model::__unset PHP Méthode

__unset() public méthode

Magic unset method, allows unset($model->property)
public __unset ( string $property ) : void
$property string
Résultat void
    public function __unset($property)
    {
        $this->orm->__unset($property);
    }

Usage Example

Exemple #1
0
 /**
  * Capture __unset() to make sure no read-only properties are erased
  *
  * @param   string  $property
  */
 public function __unset($property)
 {
     // make sure we're not unsetting a read-only value
     if (in_array($property, static::tree_config('read-only'))) {
         throw new \InvalidArgumentException('Property "' . $property . '" is read-only and can not be changed');
     }
     parent::__unset($property);
 }