You are here

public function JwPlayerSettingsCacheTag::onSave in JW Player 8

Invalidate the 'library_info' cache tag whenever the settings are modified.

Parameters

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

File

src/EventSubscriber/JwPlayerSettingsCacheTag.php, line 43
Contains \Drupal\jw_player\EventSubscriber\JwPlayerSettingsCacheTag.

Class

JwPlayerSettingsCacheTag
Invalidates the 'library_info' cache tag when saving jw_player.settings.

Namespace

Drupal\jw_player\EventSubscriber

Code

public function onSave(ConfigCrudEvent $event) {
  if ($event
    ->getConfig()
    ->getName() === 'jw_player.settings') {

    // Invalidate caches, so new libraries are created.
    $this->cacheTagsInvalidator
      ->invalidateTags(array(
      'library_info',
    ));
  }
}