function Cache::invalidateTags

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Cache/Cache.php \Drupal\Core\Cache\Cache::invalidateTags()
  2. 10 core/lib/Drupal/Core/Cache/Cache.php \Drupal\Core\Cache\Cache::invalidateTags()
  3. 11.x core/lib/Drupal/Core/Cache/Cache.php \Drupal\Core\Cache\Cache::invalidateTags()

Marks cache items from all bins with any of the specified tags as invalid.

Parameters

string[] $tags: The list of tags to invalidate cache items for.

23 calls to Cache::invalidateTags()
CacheCollector::clear in core/lib/Drupal/Core/Cache/CacheCollector.php
Clears the collected cache entry.
CacheRouterRebuildSubscriber::onRouterFinished in core/lib/Drupal/Core/EventSubscriber/CacheRouterRebuildSubscriber.php
Config::delete in core/lib/Drupal/Core/Config/Config.php
Deletes the configuration object.
Config::save in core/lib/Drupal/Core/Config/Config.php
Saves the configuration object.
ConfigEntityBase::invalidateTagsOnDelete in core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
Override to never invalidate the individual entities' cache tags; the config system already invalidates them.

... See full list

File

core/lib/Drupal/Core/Cache/Cache.php, line 147

Class

Cache
Helper methods for cache.

Namespace

Drupal\Core\Cache

Code

public static function invalidateTags(array $tags) {
  \Drupal::service('cache_tags.invalidator')->invalidateTags($tags);
}

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