You are here

public function ConfigSubscriber::onConfigSave in Analytics 8

Respond to the config save event.

Parameters

\Drupal\Core\Config\ConfigCrudEvent $event: The Event to process.

File

src/EventSubscriber/ConfigSubscriber.php, line 47

Class

ConfigSubscriber
Analytics ConfigSubscriber.

Namespace

Drupal\analytics\EventSubscriber

Code

public function onConfigSave(ConfigCrudEvent $event) {

  // Changing the Analytics settings means that any cached page might
  // result in a different response, so we need to invalidate them all.
  if ($event
    ->getConfig()
    ->getName() === 'analytics.settings') {
    $this->cacheTagsInvalidator
      ->invalidateTags([
      'rendered',
    ]);
  }
}