You are here

public function ContentEntityCdfNormalizer::__construct in Acquia Content Hub 8

Constructs an ContentEntityNormalizer object.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

\Drupal\acquia_contenthub\Normalizer\ContentEntityViewModesExtractorInterface $content_entity_view_modes_normalizer: The content entity view modes normalizer.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler to create alter hooks.

\Drupal\Core\Entity\EntityRepositoryInterface $entity_repository: The entity repository.

\Symfony\Component\HttpKernel\HttpKernelInterface $kernel: The Kernel Interface.

\Drupal\Core\Render\RendererInterface $renderer: The Renderer Interface.

\Drupal\acquia_contenthub\EntityManager $entity_manager: The entity manager.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_factory: The logger factory.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The Language Manager.

File

src/Normalizer/ContentEntityCdfNormalizer.php, line 172

Class

ContentEntityCdfNormalizer
Converts the Drupal entity object to a Acquia Content Hub CDF array.

Namespace

Drupal\acquia_contenthub\Normalizer

Code

public function __construct(ConfigFactoryInterface $config_factory, ContentEntityViewModesExtractorInterface $content_entity_view_modes_normalizer, ModuleHandlerInterface $module_handler, EntityRepositoryInterface $entity_repository, HttpKernelInterface $kernel, RendererInterface $renderer, EntityManager $entity_manager, EntityTypeManagerInterface $entity_type_manager, LoggerChannelFactoryInterface $logger_factory, LanguageManagerInterface $language_manager) {
  global $base_url;
  $this->baseUrl = $base_url;
  $this->config = $config_factory;
  $this->contentEntityViewModesNormalizer = $content_entity_view_modes_normalizer;
  $this->moduleHandler = $module_handler;
  $this->entityRepository = $entity_repository;
  $this->kernel = $kernel;
  $this->renderer = $renderer;
  $this->entityManager = $entity_manager;
  $this->entityTypeManager = $entity_type_manager;
  $this->loggerFactory = $logger_factory;
  $this->languageManager = $language_manager;

  // Setting this property only if content_translation is enabled.
  if ($this->moduleHandler
    ->moduleExists('content_translation')) {
    $this->translationManager = \Drupal::getContainer()
      ->get("content_translation.manager");
  }
}