You are here

public function DateTimeDayItem::isEmpty in Date time day 8

Determines whether the data structure is empty.

Return value

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

Overrides DateTimeItem::isEmpty

File

src/Plugin/Field/FieldType/DateTimeDayItem.php, line 146

Class

DateTimeDayItem
Plugin implementation of the 'datetimeday' field type.

Namespace

Drupal\date_time_day\Plugin\Field\FieldType

Code

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