function ContentTranslationHandler::__construct

Same name and namespace in other branches
  1. 9 core/modules/content_translation/src/ContentTranslationHandler.php \Drupal\content_translation\ContentTranslationHandler::__construct()
  2. 8.9.x core/modules/content_translation/src/ContentTranslationHandler.php \Drupal\content_translation\ContentTranslationHandler::__construct()
  3. 10 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 $entityType: The info array of the given entity type.

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

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

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

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

\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger service.

\Drupal\Core\Datetime\DateFormatterInterface $dateFormatter: The date formatter service.

\Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface $entity_last_installed_schema_repository: The installed entity definition repository service.

\Drupal\Core\Routing\RedirectDestinationInterface $redirectDestination: The request stack.

\Drupal\Component\Datetime\TimeInterface $time: The time service.

File

core/modules/content_translation/src/ContentTranslationHandler.php, line 81

Class

ContentTranslationHandler
Base class for content translation handlers.

Namespace

Drupal\content_translation

Code

public function __construct(EntityTypeInterface $entityType, LanguageManagerInterface $languageManager, ContentTranslationManagerInterface $manager, EntityTypeManagerInterface $entityTypeManager, AccountInterface $currentUser, MessengerInterface $messenger, DateFormatterInterface $dateFormatter, EntityLastInstalledSchemaRepositoryInterface $entity_last_installed_schema_repository, RedirectDestinationInterface $redirectDestination, TimeInterface $time) {
    $this->entityTypeId = $entityType->id();
    $this->fieldStorageDefinitions = $entity_last_installed_schema_repository->getLastInstalledFieldStorageDefinitions($this->entityTypeId);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.