You are here

public function LingotekProfileUsage::__construct in Lingotek Translation 8.2

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

Constructs a new LingotekProfileUsage object.

Parameters

\Drupal\lingotek\LingotekConfigurationServiceInterface $lingotek_configuration: The Lingotek configuration service.

$entity_query: (deprecated) The entity query factory.

\Drupal\config_translation\ConfigMapperManagerInterface $config_mapper_manager: The configuration mapper manager.

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

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

File

src/LingotekProfileUsage.php, line 78

Class

LingotekProfileUsage
Service for checking Lingotek profiles usage.

Namespace

Drupal\lingotek

Code

public function __construct(LingotekConfigurationServiceInterface $lingotek_configuration, $entity_query, ConfigMapperManagerInterface $config_mapper_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, EntityTypeManagerInterface $entity_type_manager = NULL) {
  $this->lingotekConfiguration = $lingotek_configuration;
  if (get_class($entity_query) === '\\Drupal\\Core\\Entity\\Query\\QueryFactory') {
    @trigger_error('The entity.query service is deprecated. Pass the entity_type.manager service to LingotekProfileUsage::__construct instead. It is required before Lingotek 9.x-1.0. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  }
  $this->configMapperManager = $config_mapper_manager;
  if (!$entity_type_bundle_info) {
    @trigger_error('The entity_type.bundle.info service must be passed to LingotekProfileUsage::__construct, it is required before Lingotek 9.x-1.0. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
    $entity_type_bundle_info = \Drupal::service('entity_type.bundle.info');
  }
  $this->entityTypeBundleInfo = $entity_type_bundle_info;
  if (!$entity_type_manager) {
    @trigger_error('The entity_type.manager service must be passed to LingotekProfileUsage::__construct, it is required before Lingotek 9.x-1.0. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
    $entity_type_manager = \Drupal::service('entity_type.manager');
  }
  $this->entityTypeManager = $entity_type_manager;
}