You are here

public function ContentTranslationHandler::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/content_translation/src/ContentTranslationHandler.php \Drupal\content_translation\ContentTranslationHandler::__construct()

Initializes an instance of the content translation controller.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The info array of the given entity type.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

\Drupal\content_translation\ContentTranslationManagerInterface $manager: The content translation manager service.

\Drupal\Core\Entity\EntityManagerInterface $entity_manager: The entity manager.

\Drupal\Core\Session\AccountInterface $current_user: The current user.

File

core/modules/content_translation/src/ContentTranslationHandler.php, line 90
Contains \Drupal\content_translation\ContentTranslationHandler.

Class

ContentTranslationHandler
Base class for content translation handlers.

Namespace

Drupal\content_translation

Code

public function __construct(EntityTypeInterface $entity_type, LanguageManagerInterface $language_manager, ContentTranslationManagerInterface $manager, EntityManagerInterface $entity_manager, AccountInterface $current_user) {
  $this->entityTypeId = $entity_type
    ->id();
  $this->entityType = $entity_type;
  $this->languageManager = $language_manager;
  $this->manager = $manager;
  $this->currentUser = $current_user;
  $this->fieldStorageDefinitions = $entity_manager
    ->getLastInstalledFieldStorageDefinitions($this->entityTypeId);
}