You are here

private function EntityManager::getReferencedEntities in Acquia Content Hub 8

Obtains a list of referenced eligible Content Hub Entities.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: An entity to check for references.

Return value

\Drupal\Core\Entity\EntityInterface[] An array of all the referenced entities

1 call to EntityManager::getReferencedEntities()
EntityManager::enqueueCandidateEntity in src/EntityManager.php
Enqueue an entity with an operation to be performed on Content Hub.

File

src/EntityManager.php, line 791

Class

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

Namespace

Drupal\acquia_contenthub

Code

private function getReferencedEntities(EntityInterface $entity) {
  $referenced_entities = $entity
    ->referencedEntities();
  foreach ($referenced_entities as $key => $referenced_entity) {
    if (!$this
      ->isSupportedContentHubEntity($referenced_entity)) {
      unset($referenced_entities[$key]);
    }
  }
  return $referenced_entities;
}