You are here

public function StateWrapper::set in Devel 8

Same name and namespace in other branches
  1. 8.3 webprofiler/src/State/StateWrapper.php \Drupal\webprofiler\State\StateWrapper::set()
  2. 8.2 webprofiler/src/State/StateWrapper.php \Drupal\webprofiler\State\StateWrapper::set()
  3. 4.x webprofiler/src/State/StateWrapper.php \Drupal\webprofiler\State\StateWrapper::set()

Implements \Drupal\Core\Cache\CacheCollectorInterface::set().

This is not persisted by default. In practice this means that setting a value will only apply while the object is in scope and will not be written back to the persistent cache. This follows a similar pattern to static vs. persistent caching in procedural code. Extending classes may wish to alter this behavior, for example by adding a call to persist().

Overrides CacheCollector::set

File

webprofiler/src/State/StateWrapper.php, line 64

Class

StateWrapper
Class StateWrapper.

Namespace

Drupal\webprofiler\State

Code

public function set($key, $value) {
  $this->state
    ->set($key, $value);
}