function DateTimeItem::isEmpty

Same name in other branches
  1. 9 core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem::isEmpty()
  2. 10 core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem::isEmpty()
  3. 11.x core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem::isEmpty()

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 === '';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.