You are here

public function LingotekMetadataEditForm::__construct in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/Form/LingotekMetadataEditForm.php \Drupal\lingotek\Form\LingotekMetadataEditForm::__construct()
  2. 4.0.x src/Form/LingotekMetadataEditForm.php \Drupal\lingotek\Form\LingotekMetadataEditForm::__construct()
  3. 3.0.x src/Form/LingotekMetadataEditForm.php \Drupal\lingotek\Form\LingotekMetadataEditForm::__construct()
  4. 3.1.x src/Form/LingotekMetadataEditForm.php \Drupal\lingotek\Form\LingotekMetadataEditForm::__construct()
  5. 3.2.x src/Form/LingotekMetadataEditForm.php \Drupal\lingotek\Form\LingotekMetadataEditForm::__construct()
  6. 3.3.x src/Form/LingotekMetadataEditForm.php \Drupal\lingotek\Form\LingotekMetadataEditForm::__construct()
  7. 3.4.x src/Form/LingotekMetadataEditForm.php \Drupal\lingotek\Form\LingotekMetadataEditForm::__construct()
  8. 3.5.x src/Form/LingotekMetadataEditForm.php \Drupal\lingotek\Form\LingotekMetadataEditForm::__construct()
  9. 3.6.x src/Form/LingotekMetadataEditForm.php \Drupal\lingotek\Form\LingotekMetadataEditForm::__construct()
  10. 3.7.x src/Form/LingotekMetadataEditForm.php \Drupal\lingotek\Form\LingotekMetadataEditForm::__construct()
  11. 3.8.x src/Form/LingotekMetadataEditForm.php \Drupal\lingotek\Form\LingotekMetadataEditForm::__construct()

Constructs a new LingotekManagementForm object.

Parameters

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

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

\Drupal\lingotek\LanguageLocaleMapperInterface $language_locale_mapper: The language-locale mapper.

\Drupal\lingotek\LingotekContentTranslationServiceInterface $translation_service: The Lingotek content translation service.

string $entity_type_id: The entity type id.

Overrides ContentEntityForm::__construct

File

src/Form/LingotekMetadataEditForm.php, line 67

Class

LingotekMetadataEditForm

Namespace

Drupal\lingotek\Form

Code

public function __construct(EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, LanguageLocaleMapperInterface $language_locale_mapper, LingotekContentTranslationServiceInterface $translation_service, ModuleHandlerInterface $module_handler, $entity_type_id) {
  parent::__construct($entity_manager);
  $this->languageManager = $language_manager;
  $this->languageLocaleMapper = $language_locale_mapper;
  $this->translationService = $translation_service;
  $this->entityTypeId = $entity_type_id;
  $this
    ->setModuleHandler($module_handler);
  $this->lingotek = \Drupal::service('lingotek');
  $this->operation = 'lingotek_metadata';
  $entity = $this
    ->getEntityFromRouteMatch($this
    ->getRouteMatch(), $this->entityTypeId);
  $this
    ->setEntity($entity);
}