You are here

protected function ContentEntityViewModesExtractor::getContentHubEntityTypeConfigEntity in Acquia Content Hub 8

Obtains the Configuration entity for the current entity type.

Parameters

string $entity_type_id: The Entity Type ID.

Return value

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

3 calls to ContentEntityViewModesExtractor::getContentHubEntityTypeConfigEntity()
ContentEntityViewModesExtractor::getPreviewImageUrl in src/Normalizer/ContentEntityViewModesExtractor.php
Get preview image URL.
ContentEntityViewModesExtractor::getRenderedViewModes in src/Normalizer/ContentEntityViewModesExtractor.php
Renders all the view modes that are configured to be rendered.
ContentEntityViewModesExtractor::getViewModeMinimalHtml in src/Normalizer/ContentEntityViewModesExtractor.php
Renders all the view modes that are configured to be rendered.

File

src/Normalizer/ContentEntityViewModesExtractor.php, line 157

Class

ContentEntityViewModesExtractor
Extracts the rendered view modes from a given ContentEntity Object.

Namespace

Drupal\acquia_contenthub\Normalizer

Code

protected function getContentHubEntityTypeConfigEntity($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;
}