You are here

public function DurationField::isEmpty in Duration Field 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldType/DurationField.php \Drupal\duration_field\Plugin\Field\FieldType\DurationField::isEmpty()
  2. 3.0.x src/Plugin/Field/FieldType/DurationField.php \Drupal\duration_field\Plugin\Field\FieldType\DurationField::isEmpty()

Determines whether the data structure is empty.

Return value

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

Overrides Map::isEmpty

File

src/Plugin/Field/FieldType/DurationField.php, line 88

Class

DurationField
Provides the 'duration' field type.

Namespace

Drupal\duration_field\Plugin\Field\FieldType

Code

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