public function EntityNG::isEmpty

Implements \Drupal\Core\TypedData\ComplexDataInterface::isEmpty().

Overrides Entity::isEmpty

File

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

Class

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

Namespace

Drupal\Core\Entity

Code

public function isEmpty() {
  if (!$this
    ->isNew()) {
    return FALSE;
  }
  foreach ($this
    ->getProperties() as $property) {
    if ($property
      ->getValue() !== NULL) {
      return FALSE;
    }
  }
  return TRUE;
}