function ContentTranslationController::__construct
Same name in other branches
- 9 core/modules/content_translation/src/Controller/ContentTranslationController.php \Drupal\content_translation\Controller\ContentTranslationController::__construct()
- 10 core/modules/content_translation/src/Controller/ContentTranslationController.php \Drupal\content_translation\Controller\ContentTranslationController::__construct()
- 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.
File
-
core/
modules/ content_translation/ src/ Controller/ ContentTranslationController.php, line 44
Class
- ContentTranslationController
- Base class for entity translation controllers.
Namespace
Drupal\content_translation\ControllerCode
public function __construct(ContentTranslationManagerInterface $manager, EntityFieldManagerInterface $entity_field_manager = NULL) {
$this->manager = $manager;
if (!$entity_field_manager) {
@trigger_error('The entity_field.manager service must be passed to ContentTranslationController::__construct(), it is required before Drupal 9.0.0. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
$entity_field_manager = \Drupal::service('entity_field.manager');
}
$this->entityFieldManager = $entity_field_manager;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.