You are here

public function EntityManager::getContentHubEntityTypeConfigurationEntity in Acquia Content Hub 8

Returns the Content Hub configuration entity for this entity type.

Parameters

string $entity_type_id: The Entity type ID.

Return value

bool|\Drupal\acquia_contenthub\ContentHubEntityTypeConfigInterface The Configuration entity if exists, FALSE otherwise.

1 call to EntityManager::getContentHubEntityTypeConfigurationEntity()
EntityManager::isEligibleEntity in src/EntityManager.php
Checks whether the current entity should be transferred to Content Hub.

File

src/EntityManager.php, line 683

Class

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

Namespace

Drupal\acquia_contenthub

Code

public function getContentHubEntityTypeConfigurationEntity($entity_type_id) {

  /** @var \Drupal\rest\RestResourceConfigInterface $contenthub_entity_config_storage */
  $contenthub_entity_config_storage = $this->entityTypeManager
    ->getStorage('acquia_contenthub_entity_config');

  /** @var \Drupal\acquia_contenthub\ContentHubEntityTypeConfigInterface[] $contenthub_entity_config_ids */
  $contenthub_entity_config_ids = $contenthub_entity_config_storage
    ->loadMultiple([
    $entity_type_id,
  ]);
  $contenthub_entity_config_id = isset($contenthub_entity_config_ids[$entity_type_id]) ? $contenthub_entity_config_ids[$entity_type_id] : FALSE;
  return $contenthub_entity_config_id;
}