You are here

public function MissingUuid::onEnqueueCandidateEntity in Acquia Content Hub 8.2

Skips entities missing its UUID.

Parameters

\Drupal\acquia_contenthub_publisher\Event\ContentHubEntityEligibilityEvent $event: The event to determine entity eligibility.

Throws

\Exception

File

modules/acquia_contenthub_publisher/src/EventSubscriber/EnqueueEligibility/MissingUuid.php, line 35

Class

MissingUuid
Any entity that is missing its UUID shouldn't be enqueued.

Namespace

Drupal\acquia_contenthub_publisher\EventSubscriber\EnqueueEligibility

Code

public function onEnqueueCandidateEntity(ContentHubEntityEligibilityEvent $event) {
  $entity = $event
    ->getEntity();
  if (!Uuid::isValid($entity
    ->uuid())) {
    $event
      ->setEligibility(FALSE);
    $event
      ->stopPropagation();
  }
}