You are here

public function ShapeItem::isEmpty in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ShapeItem.php \Drupal\entity_test\Plugin\Field\FieldType\ShapeItem::isEmpty()
  2. 9 core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ShapeItem.php \Drupal\entity_test\Plugin\Field\FieldType\ShapeItem::isEmpty()

Determines whether the data structure is empty.

Return value

bool TRUE if the data structure is empty, FALSE otherwise.

Overrides Map::isEmpty

File

core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ShapeItem.php, line 75

Class

ShapeItem
Defines the 'shape' field type.

Namespace

Drupal\entity_test\Plugin\Field\FieldType

Code

public function isEmpty() {
  $item = $this
    ->getValue();
  return empty($item['shape']) && empty($item['color']);
}