You are here

protected function CacheCollector::persist in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::persist()
  2. 9 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 unflagged so that it will not be written at the end of the request.

10 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 193

Class

CacheCollector
Default implementation for CacheCollectorInterface.

Namespace

Drupal\Core\Cache

Code

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