You are here

public function YearOnlyItem::isEmpty in Year Only 8

Same name and namespace in other branches
  1. 9.0.x src/Plugin/Field/FieldType/YearOnlyItem.php \Drupal\yearonly\Plugin\Field\FieldType\YearOnlyItem::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/YearOnlyItem.php, line 55

Class

YearOnlyItem
Plugin implementation of the 'yearonly' field type.

Namespace

Drupal\yearonly\Plugin\Field\FieldType

Code

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