function Cache::invalidateTags

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Cache/Cache.php \Drupal\Core\Cache\Cache::invalidateTags()
  2. 9 core/lib/Drupal/Core/Cache/Cache.php \Drupal\Core\Cache\Cache::invalidateTags()
  3. 8.9.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.

60 calls to Cache::invalidateTags()
AnnounceTestHttpClientMiddleware::setAnnounceTestEndpoint in core/modules/announcements_feed/tests/modules/announce_feed_test/src/AnnounceTestHttpClientMiddleware.php
Sets the test endpoint for the advisories JSON feed.
BlockCacheTest::testCachePerRole in core/modules/block/tests/src/Functional/BlockCacheTest.php
Tests "user.roles" cache context.
BlockViewBuilderTest::testBlockViewBuilderViewAlter in core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
Tests block view altering.
block_install in core/modules/block/block.install
Implements hook_install().
CacheCollector::clear in core/lib/Drupal/Core/Cache/CacheCollector.php
Clears the collected cache entry.

... See full list

File

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

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.