You are here

public function TextItemBase::isEmpty in Drupal 8

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()

Determines whether the data structure is empty.

Return value

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

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