function TextItemBase::isEmpty

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

Overrides Map::isEmpty

1 call to TextItemBase::isEmpty()
TextWithSummaryItem::isEmpty in core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php
Determines whether the data structure is empty.
1 method overrides TextItemBase::isEmpty()
TextWithSummaryItem::isEmpty in core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php
Determines whether the data structure is empty.

File

core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php, line 50

Class

TextItemBase
Base class for 'text' configurable field types.

Namespace

Drupal\text\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.