public function EntityNG::__unset

Magic method.

File

drupal/core/lib/Drupal/Core/Entity/EntityNG.php, line 378
Definition of 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->compatibilityMode) {
    unset($this->values[$name]);
  }
  elseif ($this
    ->getPropertyDefinition($name)) {
    $this
      ->get($name)
      ->setValue(array());
  }
}