function CacheCollectorInterface::set

Same name in other branches
  1. 9 core/lib/Drupal/Core/Cache/CacheCollectorInterface.php \Drupal\Core\Cache\CacheCollectorInterface::set()
  2. 8.9.x core/lib/Drupal/Core/Cache/CacheCollectorInterface.php \Drupal\Core\Cache\CacheCollectorInterface::set()
  3. 11.x core/lib/Drupal/Core/Cache/CacheCollectorInterface.php \Drupal\Core\Cache\CacheCollectorInterface::set()

Sets cache data.

It depends on the specific case and implementation whether this has a permanent effect or if it just affects the current request.

Parameters

string $key: Key that identifies the data.

mixed $value: The data to be set.

2 methods override CacheCollectorInterface::set()
CacheCollector::set in core/lib/Drupal/Core/Cache/CacheCollector.php
Implements \Drupal\Core\Cache\CacheCollectorInterface::set().
MenuActiveTrail::set in core/lib/Drupal/Core/ProxyClass/Menu/MenuActiveTrail.php
Sets cache data.

File

core/lib/Drupal/Core/Cache/CacheCollectorInterface.php, line 43

Class

CacheCollectorInterface
Provides a caching wrapper to be used in place of large structures.

Namespace

Drupal\Core\Cache

Code

public function set($key, $value);

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