You are here

public function ScheduledPublish::isEmpty in Scheduled Publish 8.3

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldType/ScheduledPublish.php \Drupal\scheduled_publish\Plugin\Field\FieldType\ScheduledPublish::isEmpty()
  2. 8.2 src/Plugin/Field/FieldType/ScheduledPublish.php \Drupal\scheduled_publish\Plugin\Field\FieldType\ScheduledPublish::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/ScheduledPublish.php, line 99

Class

ScheduledPublish
Plugin implementation of the 'scheduled_publish_type' field type.

Namespace

Drupal\scheduled_publish\Plugin\Field\FieldType

Code

public function isEmpty() {
  $is_moderation_state = empty($this
    ->get('moderation_state')
    ->getValue());
  $is_value = empty($this
    ->get('value')
    ->getValue());
  return $is_moderation_state || $is_value;
}