You are here

public function TextWithSummaryItem::isEmpty in Drupal 10

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

Determines whether the data structure is empty.

Return value

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

Overrides TextItemBase::isEmpty

File

core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php, line 80

Class

TextWithSummaryItem
Plugin implementation of the 'text_with_summary' field type.

Namespace

Drupal\text\Plugin\Field\FieldType

Code

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