public function EntityNG::__unset

Implements the magic method for unset.

File

drupal/core/lib/Drupal/Core/Entity/EntityNG.php, line 533
Contains \Drupal\Core\Entity\EntityNG.

Class

EntityNG
Implements Entity Field API specific enhancements to the Entity class.

Namespace

Drupal\Core\Entity

Code

public function __unset($name) {
  if ($this
    ->getPropertyDefinition($name)) {
    $this
      ->get($name)
      ->setValue(NULL);
  }
  else {
    unset($this->values[$name]);
  }
}