You are here

public function LingotekWorkbenchModerationSettingsForm::__construct in Lingotek Translation 3.6.x

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

Constructs a new LingotekWorkbenchModerationSettingsForm object.

Parameters

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

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

\Drupal\lingotek\Moderation\LingotekModerationConfigurationServiceInterface $moderation_configuration: A Lingotek moderation configuration service.

\Symfony\Component\DependencyInjection\ContainerInterface $container: The container from which optional services can be requested.

\Drupal\Core\Routing\UrlGeneratorInterface $url_generator: The url generator.

File

src/Moderation/LingotekWorkbenchModerationSettingsForm.php, line 64

Class

LingotekWorkbenchModerationSettingsForm
Moderation settings form for the Lingotek workbench_moderation integration.

Namespace

Drupal\lingotek\Moderation

Code

public function __construct(ModuleHandlerInterface $module_handler, EntityTypeManagerInterface $entity_type_manager, LingotekModerationConfigurationServiceInterface $moderation_configuration, ContainerInterface $container, UrlGeneratorInterface $url_generator = NULL) {
  $this
    ->setModuleHandler($module_handler);
  $this->entityTypeManager = $entity_type_manager;
  $this->moderationConfiguration = $moderation_configuration;

  // We need a service we cannot depend on, as it may not exist if the module
  // is not present. Ignore the error.
  if ($container
    ->has('workbench_moderation.moderation_information')) {
    $this->moderationInfo = $container
      ->get('workbench_moderation.moderation_information');
  }
  $this->urlGenerator = $url_generator;
}