You are here

public function DateTimeItem::isEmpty in Drupal 10

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

Determines whether the data structure is empty.

Return value

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

Overrides Map::isEmpty

1 method overrides DateTimeItem::isEmpty()
DateRangeItem::isEmpty in core/modules/datetime_range/src/Plugin/Field/FieldType/DateRangeItem.php
Determines whether the data structure is empty.

File

core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php, line 123

Class

DateTimeItem
Plugin implementation of the 'datetime' field type.

Namespace

Drupal\datetime\Plugin\Field\FieldType

Code

public function isEmpty() {
  $value = $this
    ->get('value')
    ->getValue();
  return $value === NULL || $value === '';
}