function CacheCollector::persist

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

Flags an offset value to be written to the persistent cache.

Parameters

string $key: The key that was requested.

bool $persist: (optional) Whether the offset should be persisted or not, defaults to TRUE. When called with $persist = FALSE the offset will be un-flagged so that it will not be written at the end of the request.

13 calls to CacheCollector::persist()
AliasWhitelist::loadMenuPathRoots in core/modules/path_alias/src/AliasWhitelist.php
Loads menu path roots to prepopulate cache.
AliasWhitelist::resolveCacheMiss in core/modules/path_alias/src/AliasWhitelist.php
Resolves a cache miss.
BlockContentUuidLookup::resolveCacheMiss in core/modules/block_content/src/BlockContentUuidLookup.php
Resolves a cache miss.
CacheCollectorHelper::resolveCacheMiss in core/tests/Drupal/Tests/Core/Cache/CacheCollectorHelper.php
Resolves a cache miss.
CacheCollectorHelper::set in core/tests/Drupal/Tests/Core/Cache/CacheCollectorHelper.php
Implements \Drupal\Core\Cache\CacheCollectorInterface::set().

... See full list

File

core/lib/Drupal/Core/Cache/CacheCollector.php, line 196

Class

CacheCollector
Default implementation for CacheCollectorInterface.

Namespace

Drupal\Core\Cache

Code

protected function persist($key, $persist = TRUE) {
    $this->keysToPersist[$key] = $persist;
}

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