You are here

private function EntityManager::enqueueCandidateParagraph in Acquia Content Hub 8

Enqueue a paragraph with an operation to be performed on Content Hub.

Parameters

\Drupal\paragraphs\ParagraphInterface $paragraph: The Paragraph object.

bool $do_export: TRUE if the entity action is 'EXPORT'; FALSE, if it is 'UNEXPORT'.

1 call to EntityManager::enqueueCandidateParagraph()
EntityManager::enqueueQualifiedEntities in src/EntityManager.php
Enqueue array of entities with an operation to be performed on Content Hub.

File

src/EntityManager.php, line 240

Class

EntityManager
Provides a service for managing entity actions for Content Hub.

Namespace

Drupal\acquia_contenthub

Code

private function enqueueCandidateParagraph(ParagraphInterface $paragraph, $do_export) {

  // Early return, if entity is not eligible.
  if (!$this
    ->isEligibleEntity($paragraph)) {
    return;
  }
  $referenced_entities = $paragraph
    ->referencedEntities();
  $this
    ->enqueueQualifiedEntities($referenced_entities, $do_export);
  $action = $do_export ? self::EXPORT : self::UNEXPORT;
  $this->candidateEntities[$action][$paragraph
    ->uuid()] = $paragraph;
}