You are here

public function SmartDateItem::isEmpty in Smart Date 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldType/SmartDateItem.php \Drupal\smart_date\Plugin\Field\FieldType\SmartDateItem::isEmpty()
  2. 3.x src/Plugin/Field/FieldType/SmartDateItem.php \Drupal\smart_date\Plugin\Field\FieldType\SmartDateItem::isEmpty()
  3. 3.0.x src/Plugin/Field/FieldType/SmartDateItem.php \Drupal\smart_date\Plugin\Field\FieldType\SmartDateItem::isEmpty()
  4. 3.1.x src/Plugin/Field/FieldType/SmartDateItem.php \Drupal\smart_date\Plugin\Field\FieldType\SmartDateItem::isEmpty()
  5. 3.2.x src/Plugin/Field/FieldType/SmartDateItem.php \Drupal\smart_date\Plugin\Field\FieldType\SmartDateItem::isEmpty()
  6. 3.3.x src/Plugin/Field/FieldType/SmartDateItem.php \Drupal\smart_date\Plugin\Field\FieldType\SmartDateItem::isEmpty()
  7. 3.4.x src/Plugin/Field/FieldType/SmartDateItem.php \Drupal\smart_date\Plugin\Field\FieldType\SmartDateItem::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/SmartDateItem.php, line 100

Class

SmartDateItem
Plugin implementation of the 'smartdate' field type.

Namespace

Drupal\smart_date\Plugin\Field\FieldType

Code

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