Skip to content

Drupal\helper\EventSubscriber\ConfigCacheTagInvalidator

A subscriber for invalidating cache tags when a config object is saved.

Implements:

Symfony\Component\EventDispatcher\EventSubscriberInterface

Methods

Name Description
__construct Constructs a ConfigCacheTagInvalidator object.
getSubscribedEvents {@inheritdoc}
onChange Invalidate the cache tags whenever the config is changed.

ConfigCacheTagInvalidator::__construct

Description

public __construct (\Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator, string $config_name, array $cache_tags)

Constructs a ConfigCacheTagInvalidator object.

Parameters

  • (\Drupal\Core\Cache\CacheTagsInvalidatorInterface) $cache_tags_invalidator :
    The cache tags invalidator.
  • (string) $config_name :
    The configuration object name.
  • (array) $cache_tags :
    The cache tags to invalidate when the configuration object is changed.

Return Values

void


ConfigCacheTagInvalidator::getSubscribedEvents

Description

public static getSubscribedEvents (void)

{@inheritdoc}

Parameters

This function has no parameters.

Return Values

void


ConfigCacheTagInvalidator::onChange

Description

public onChange (\Drupal\Core\Config\ConfigCrudEvent $event)

Invalidate the cache tags whenever the config is changed.

Parameters

  • (\Drupal\Core\Config\ConfigCrudEvent) $event :
    The configuration event to process.

Return Values

void