function LruMemoryCache::invalidateTags

Overrides MemoryBackend::invalidateTags

File

core/lib/Drupal/Core/Cache/MemoryCache/LruMemoryCache.php, line 115

Class

LruMemoryCache
Defines a least recently used (LRU) static cache implementation.

Namespace

Drupal\Core\Cache\MemoryCache

Code

public function invalidateTags(array $tags) : void {
    $items = [];
    foreach ($this->cache as $cid => $item) {
        if (array_intersect($tags, $item->tags)) {
            parent::invalidate($cid);
            $items[$cid] = $this->cache[$cid];
        }
    }
    $this->moveItemsToLeastRecentlyUsed($items);
}

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