You are here

public function ConfigMapperManager::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/config_translation/src/ConfigMapperManager.php \Drupal\config_translation\ConfigMapperManager::__construct()

Constructs a ConfigMapperManager.

Parameters

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

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

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

\Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager: The typed config manager.

\Drupal\Core\Extension\ThemeHandlerInterface $theme_handler: The theme handler.

Overrides DefaultPluginManager::__construct

File

core/modules/config_translation/src/ConfigMapperManager.php, line 63

Class

ConfigMapperManager
Manages plugins for configuration translation mappers.

Namespace

Drupal\config_translation

Code

public function __construct(CacheBackendInterface $cache_backend, LanguageManagerInterface $language_manager, ModuleHandlerInterface $module_handler, TypedConfigManagerInterface $typed_config_manager, ThemeHandlerInterface $theme_handler) {
  $this->typedConfigManager = $typed_config_manager;
  $this->factory = new ContainerFactory($this, '\\Drupal\\config_translation\\ConfigMapperInterface');

  // Let others alter definitions with hook_config_translation_info_alter().
  $this->moduleHandler = $module_handler;
  $this->themeHandler = $theme_handler;
  $this
    ->alterInfo('config_translation_info');

  // Config translation only uses an info hook discovery, cache by language.
  $cache_key = 'config_translation_info_plugins' . ':' . $language_manager
    ->getCurrentLanguage()
    ->getId();
  $this
    ->setCacheBackend($cache_backend, $cache_key, [
    'config_translation_info_plugins',
  ]);
}