public function Map::isEmpty

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

Overrides ComplexDataInterface::isEmpty

1 method overrides Map::isEmpty()
TextItem::isEmpty in drupal/core/modules/text/lib/Drupal/text/Type/TextItem.php
Implements \Drupal\Core\TypedData\ComplexDataInterface::isEmpty().

File

drupal/core/lib/Drupal/Core/TypedData/Type/Map.php, line 197
Contains \Drupal\Core\TypedData\Type\Map.

Class

Map
The "map" data type.

Namespace

Drupal\Core\TypedData\Type

Code

public function isEmpty() {
  foreach ($this->properties as $property) {
    $definition = $property
      ->getDefinition();
    if (empty($definition['computed']) && $property
      ->getValue() !== NULL) {
      return FALSE;
    }
  }
  if (isset($this->values)) {
    foreach ($this->values as $name => $value) {
      if (isset($value) && !isset($this->properties[$name])) {
        return FALSE;
      }
    }
  }
  return TRUE;
}