You are here

public function EntityManager::isSupportedContentHubEntity in Acquia Content Hub 8

Checks whether the current entity is supported by Content Hub.

Parameters

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

Return value

bool TRUE if it is a supported entity, FALSE otherwise.

1 call to EntityManager::isSupportedContentHubEntity()
EntityManager::getReferencedEntities in src/EntityManager.php
Obtains a list of referenced eligible Content Hub Entities.

File

src/EntityManager.php, line 767

Class

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

Namespace

Drupal\acquia_contenthub

Code

public function isSupportedContentHubEntity(EntityInterface $entity) {

  // If the entity is not a Content Entity then it is not supported.
  if (!$entity instanceof ContentEntityInterface) {
    return FALSE;
  }

  // From all content entities, some of them are excluded.
  $excluded_types = $this
    ->getExcludedContentEntityTypeIds();
  if (in_array($entity
    ->getEntityTypeId(), $excluded_types)) {
    return FALSE;
  }
  return TRUE;
}