public function TimeRangeType::isEmpty in Time Field For Drupal 8.x / 9.x 8
Same name and namespace in other branches
- 2.x src/Plugin/Field/FieldType/TimeRangeType.php \Drupal\time_field\Plugin\Field\FieldType\TimeRangeType::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/ TimeRangeType.php, line 70
Class
- TimeRangeType
- Plugin implementation of the 'time' field type.
Namespace
Drupal\time_field\Plugin\Field\FieldTypeCode
public function isEmpty() {
$from = $this
->get('from')
->getValue();
$to = $this
->get('to')
->getValue();
return trim($from) === '' || trim($to) === '';
}