You are here

private function EntityManager::findRootAncestorEntity in Acquia Content Hub 8

Returns the entity's root ancestor.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The current (child) entity.

Return value

\Drupal\Core\Entity\EntityInterface The root ancestor entity.

1 call to EntityManager::findRootAncestorEntity()
EntityManager::unexportDisqualifiedExportCandidateEntities in src/EntityManager.php
Delete entities from Content Hub that are disqualified of exporting.

File

src/EntityManager.php, line 810

Class

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

Namespace

Drupal\acquia_contenthub

Code

private function findRootAncestorEntity(EntityInterface $entity) {
  if (!$entity || !method_exists($entity, 'getParentEntity')) {
    return $entity;
  }
  return $this
    ->findRootAncestorEntity($entity
    ->getParentEntity());
}