function Cache::invalidateTags

Same name 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.

61 calls to Cache::invalidateTags()
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
Test "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().
BookManager::deleteFromBook in core/modules/book/src/BookManager.php
Deletes node's entry from book table.

... 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.