function LocaleLookup::__construct

Same name in other branches
  1. 9 core/modules/locale/src/LocaleLookup.php \Drupal\locale\LocaleLookup::__construct()
  2. 8.9.x core/modules/locale/src/LocaleLookup.php \Drupal\locale\LocaleLookup::__construct()
  3. 11.x core/modules/locale/src/LocaleLookup.php \Drupal\locale\LocaleLookup::__construct()

Constructs a LocaleLookup object.

Parameters

string $langcode: The language code.

string $context: The string context.

\Drupal\locale\StringStorageInterface $string_storage: The string storage.

\Drupal\Core\Cache\CacheBackendInterface $cache: The cache backend.

\Drupal\Core\Lock\LockBackendInterface $lock: The lock backend.

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

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

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

Overrides CacheCollector::__construct

File

core/modules/locale/src/LocaleLookup.php, line 94

Class

LocaleLookup
A cache collector to allow for dynamic building of the locale cache.

Namespace

Drupal\locale

Code

public function __construct($langcode, $context, StringStorageInterface $string_storage, CacheBackendInterface $cache, LockBackendInterface $lock, ConfigFactoryInterface $config_factory, LanguageManagerInterface $language_manager, RequestStack $request_stack) {
    $this->langcode = $langcode;
    $this->context = (string) $context;
    $this->stringStorage = $string_storage;
    $this->configFactory = $config_factory;
    $this->languageManager = $language_manager;
    $this->cache = $cache;
    $this->lock = $lock;
    $this->tags = [
        'locale',
    ];
    $this->requestStack = $request_stack;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.