function DrupalCacheArray::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 requested.

$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 be written at the end of the request.

2 calls to DrupalCacheArray::persist()
SchemaCache::resolveCacheMiss in includes/bootstrap.inc
Overrides DrupalCacheArray::resolveCacheMiss().
ThemeRegistry::resolveCacheMiss in includes/theme.inc
Resolves a cache miss.

File

includes/bootstrap.inc, line 411

Class

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

Code

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

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