public function EntityNG::isEmpty

Implements ComplexDataInterface::isEmpty().

Overrides Entity::isEmpty

File

drupal/core/lib/Drupal/Core/Entity/EntityNG.php, line 195
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 isEmpty() {
  if (!$this
    ->isNew()) {
    return FALSE;
  }
  foreach ($this
    ->getProperties() as $property) {
    if ($property
      ->getValue() !== NULL) {
      return FALSE;
    }
  }
  return TRUE;
}