function CacheTagsInvalidator::invalidateTags

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

Overrides CacheTagsInvalidatorInterface::invalidateTags

File

core/lib/Drupal/Core/Cache/CacheTagsInvalidator.php, line 29

Class

CacheTagsInvalidator
Passes cache tag events to classes that wish to respond to them.

Namespace

Drupal\Core\Cache

Code

public function invalidateTags(array $tags) {
    assert(Inspector::assertAllStrings($tags), 'Cache tags must be strings.');
    // Notify all added cache tags invalidators.
    foreach ($this->invalidators as $invalidator) {
        $invalidator->invalidateTags($tags);
    }
    // Additionally, notify each cache bin if it implements the service.
    foreach ($this->bins as $bin) {
        $bin->invalidateTags($tags);
    }
}

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