You are here

private function EntityManager::unexportDisqualifiedExportCandidateEntities in Acquia Content Hub 8

Delete entities from Content Hub that are disqualified of exporting.

1 call to EntityManager::unexportDisqualifiedExportCandidateEntities()
EntityManager::bulkExport in src/EntityManager.php
Bulk-export all the enqueued entities.

File

src/EntityManager.php, line 344

Class

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

Namespace

Drupal\acquia_contenthub

Code

private function unexportDisqualifiedExportCandidateEntities() {
  $candidate_entites = $this->candidateEntities[self::EXPORT];
  foreach ($candidate_entites as $uuid => $candidate_entity) {
    $root_ancestor_entity = $this
      ->findRootAncestorEntity($candidate_entity);

    // If root ancestor is not published, delete the current entity.
    if ($root_ancestor_entity instanceof NodeInterface && !$this
      ->isPublished($root_ancestor_entity)) {
      $this->candidateEntities[self::UNEXPORT][$uuid] = $candidate_entity;
      unset($this->candidateEntities[self::EXPORT][$uuid]);
    }
  }
}