You are here

public function ImportedEntity::onEnqueueCandidateEntity in Acquia Content Hub 8.2

Prevents tracked imported entities to end up in the export queue.

Parameters

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

Throws

\Exception

File

modules/acquia_contenthub_publisher/src/EventSubscriber/EnqueueEligibility/ImportedEntity.php, line 53

Class

ImportedEntity
Any entity that has been previously imported shouldn't be enqueued.

Namespace

Drupal\acquia_contenthub_publisher\EventSubscriber\EnqueueEligibility

Code

public function onEnqueueCandidateEntity(ContentHubEntityEligibilityEvent $event) {
  $entity = $event
    ->getEntity();
  if (!empty($this->subscriberTracker) && $this->subscriberTracker
    ->isTracked($entity
    ->uuid())) {
    $event
      ->setEligibility(FALSE);
    $event
      ->stopPropagation();
  }
}