function VariationCacheInterface::set

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Cache/VariationCacheInterface.php \Drupal\Core\Cache\VariationCacheInterface::set()

Stores data in the cache.

Parameters

string[] $keys: The cache keys of the data to store.

mixed $data: The data to store in the cache.

\Drupal\Core\Cache\CacheableDependencyInterface $cacheability: The cache metadata of the data to store.

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

Throws

\LogicException Thrown when cacheability is provided that does not contain a cache context or does not completely contain the initial cacheability.

See also

\Drupal\Core\Cache\CacheBackendInterface::set()

1 method overrides VariationCacheInterface::set()
VariationCache::set in core/lib/Drupal/Core/Cache/VariationCache.php
Stores data in the cache.

File

core/lib/Drupal/Core/Cache/VariationCacheInterface.php, line 51

Class

VariationCacheInterface
Defines an interface for variation cache implementations.

Namespace

Drupal\Core\Cache

Code

public function set(array $keys, $data, CacheableDependencyInterface $cacheability, CacheableDependencyInterface $initial_cacheability) : void;

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