function Cache::invalidateTags

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

62 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);
}

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