You are here

public function EntityManager::isEligibleDependency in Acquia Content Hub 8

Checks whether the current dependency should be transferred to Content Hub.

Dependencies have an additional check as to whether they should be trans- ferred to Content Hub. If they have been previously exported then they do not need to be exported again. Dependent entities are those which are referenced from an entity that has been fired through entity hooks.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity object.

Return value

bool TRUE if it is eligible for export to Content Hub, FALSE otherwise.

File

src/EntityManager.php, line 640

Class

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

Namespace

Drupal\acquia_contenthub

Code

public function isEligibleDependency(EntityInterface $entity) {
  if ($this
    ->isEligibleEntity($entity)) {
    if ($entity_tracking = $this->contentHubEntitiesTracking
      ->loadExportedByUuid($entity
      ->uuid())) {
      if ($entity_tracking
        ->isExported()) {
        return FALSE;
      }
    }
    return TRUE;
  }
  return FALSE;
}