function ConfigCacheTag::__construct

Same name and namespace in other branches
  1. 9 core/modules/system/src/EventSubscriber/ConfigCacheTag.php \Drupal\system\EventSubscriber\ConfigCacheTag::__construct()
  2. 8.9.x core/modules/system/src/EventSubscriber/ConfigCacheTag.php \Drupal\system\EventSubscriber\ConfigCacheTag::__construct()
  3. 11.x core/modules/system/src/EventSubscriber/ConfigCacheTag.php \Drupal\system\EventSubscriber\ConfigCacheTag::__construct()

Constructs a ConfigCacheTag object.

Parameters

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

\Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator: The cache tags invalidator.

\Drupal\Core\Theme\Registry|null $themeRegistry: The theme registry.

File

core/modules/system/src/EventSubscriber/ConfigCacheTag.php, line 41

Class

ConfigCacheTag
A subscriber invalidating cache tags when system config objects are saved.

Namespace

Drupal\system\EventSubscriber

Code

public function __construct(ThemeHandlerInterface $theme_handler, CacheTagsInvalidatorInterface $cache_tags_invalidator, ?Registry $themeRegistry = NULL) {
    $this->themeHandler = $theme_handler;
    $this->cacheTagsInvalidator = $cache_tags_invalidator;
    if ($this->themeRegistry === NULL) {
        @trigger_error('Calling ' . __METHOD__ . '() without the $themeRegistry argument is deprecated in drupal:10.2.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3355227', E_USER_DEPRECATED);
        $this->themeRegistry = \Drupal::service('theme.registry');
    }
}

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