function VariationCache::delete
Same name and namespace in other branches
- 10 core/lib/Drupal/Core/Cache/VariationCache.php \Drupal\Core\Cache\VariationCache::delete()
Deletes an item from the cache.
To stay consistent with ::get(), this only affects the active variation, not all possible variations for the associated cache contexts.
Parameters
string[] $keys: The cache keys of the data to delete.
\Drupal\Core\Cache\CacheableDependencyInterface $initial_cacheability: The cache metadata of the data to store before other systems had a chance to adjust it. This is also commonly known as "pre-bubbling" cacheability.
Overrides VariationCacheInterface::delete
File
-
core/
lib/ Drupal/ Core/ Cache/ VariationCache.php, line 287
Class
- VariationCache
- Wraps a regular cache backend to make it support cache contexts.
Namespace
Drupal\Core\CacheCode
public function delete(array $keys, CacheableDependencyInterface $initial_cacheability) : void {
$chain = $this->getRedirectChain($keys, $initial_cacheability);
// Don't need to delete what could not be found.
if (end($chain) === FALSE) {
return;
}
unset($this->redirectChainCache[$this->createCacheIdFast($keys, $initial_cacheability)]);
$this->cacheBackend
->delete(array_key_last($chain));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.