protected function CacheArray::persist

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

If a value is assigned to a cache object with offsetSet(), by default it will not be written to the persistent cache unless it is flagged with this method. This allows items to be cached for the duration of a request, without necessarily writing back to the persistent cache at the end.

Parameters

$offset: The array offset that was request.

$persist: Optional boolean to specify 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 written at the end of the request.

6 calls to CacheArray::persist()
AliasWhitelist::loadMenuPathRoots in drupal/core/lib/Drupal/Core/Path/AliasWhitelist.php
Loads menu path roots to prepopulate cache.
AliasWhitelist::resolveCacheMiss in drupal/core/lib/Drupal/Core/Path/AliasWhitelist.php
Overrides \Drupal\Core\Utility\CacheArray::resolveCacheMiss().
LocaleLookup::resolveCacheMiss in drupal/core/modules/locale/lib/Drupal/locale/LocaleLookup.php
Resolves a cache miss.
ModuleInfo::resolveCacheMiss in drupal/core/lib/Drupal/Core/Utility/ModuleInfo.php
Implements CacheArray::resolveCacheMiss().
SchemaCache::resolveCacheMiss in drupal/core/lib/Drupal/Core/Utility/SchemaCache.php
Implements CacheArray::resolveCacheMiss().

... See full list

File

drupal/core/lib/Drupal/Core/Utility/CacheArray.php, line 172
Definition of CacheArray

Class

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

Namespace

Drupal\Core\Utility

Code

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