You are here

public function LingotekContentModerationHandler::__construct in Lingotek Translation 3.7.x

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

Constructs a new LingotekContentModerationHandler 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.

\Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info: The entity type bundle service.

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

File

src/Moderation/LingotekContentModerationHandler.php, line 64

Class

LingotekContentModerationHandler
Content moderation handler managing the Lingotek integration.

Namespace

Drupal\lingotek\Moderation

Code

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

  // 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('content_moderation.moderation_information')) {
    $this->moderationInfo = $container
      ->get('content_moderation.moderation_information');
  }
}