You are here

public function Lingotek::__construct in Lingotek Translation 3.3.x

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

Constructs a Lingotek object.

Parameters

\Drupal\lingotek\Remote\LingotekApiInterface $api: The Lingotek configuration service.

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

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

LingotekFilterManagerInterface $lingotek_filter_manager: The Lingotek Filter manager.

File

src/Lingotek.php, line 86

Class

Lingotek
The connecting class between Drupal and Lingotek

Namespace

Drupal\lingotek

Code

public function __construct(LingotekApiInterface $api, LanguageLocaleMapperInterface $language_locale_mapper, ConfigFactoryInterface $config_factory, LingotekFilterManagerInterface $lingotek_filter_manager, LingotekConfigurationServiceInterface $lingotek_configuration = NULL) {
  $this->api = $api;
  $this->languageLocaleMapper = $language_locale_mapper;
  $this->configFactory = $config_factory;
  $this->lingotekFilterManager = $lingotek_filter_manager;
  if (!$lingotek_configuration) {
    @trigger_error('The lingotek.configuration service must be passed to Lingotek::__construct, it is included in lingotek:3.1.0 and required for lingotek:4.0.0.', E_USER_DEPRECATED);
    $lingotek_configuration = \Drupal::service('lingotek.configuration');
  }
  $this->lingotekConfiguration = $lingotek_configuration;
}