Same name and namespace in other branches
  1. 8.9.x 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()

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.

55 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.
Block::postSave in core/modules/block/src/Entity/Block.php
Acts on a saved entity before the insert or update hook is invoked.
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().

... See full list

File

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

Class

Cache
Helper methods for cache.

Namespace

Drupal\Core\Cache

Code

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