function ContentTranslationController::__construct

Same name in other branches
  1. 9 core/modules/content_translation/src/Controller/ContentTranslationController.php \Drupal\content_translation\Controller\ContentTranslationController::__construct()
  2. 8.9.x core/modules/content_translation/src/Controller/ContentTranslationController.php \Drupal\content_translation\Controller\ContentTranslationController::__construct()
  3. 11.x core/modules/content_translation/src/Controller/ContentTranslationController.php \Drupal\content_translation\Controller\ContentTranslationController::__construct()

Initializes a content translation controller.

Parameters

\Drupal\content_translation\ContentTranslationManagerInterface $manager: A content translation manager instance.

\Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager: The entity field manager service.

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

File

core/modules/content_translation/src/Controller/ContentTranslationController.php, line 47

Class

ContentTranslationController
Base class for entity translation controllers.

Namespace

Drupal\content_translation\Controller

Code

public function __construct(ContentTranslationManagerInterface $manager, EntityFieldManagerInterface $entity_field_manager, ?TimeInterface $time = NULL) {
    $this->manager = $manager;
    $this->entityFieldManager = $entity_field_manager;
    if ($this->time === NULL) {
        @trigger_error('Calling ' . __METHOD__ . ' without the $time argument is deprecated in drupal:10.3.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3112298', E_USER_DEPRECATED);
        $this->time = \Drupal::service('datetime.time');
    }
}

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