You are here

protected function CacheCollector::lazyLoadCache in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::lazyLoadCache()
  2. 10 core/lib/Drupal/Core/Cache/CacheCollector.php \Drupal\Core\Cache\CacheCollector::lazyLoadCache()

Loads the cache if not already done.

4 calls to CacheCollector::lazyLoadCache()
AliasWhitelist::lazyLoadCache in core/modules/path_alias/src/AliasWhitelist.php
Loads the cache if not already done.
CacheCollector::delete in core/lib/Drupal/Core/Cache/CacheCollector.php
Deletes the element.
CacheCollector::get in core/lib/Drupal/Core/Cache/CacheCollector.php
Gets value from the cache.
CacheCollector::set in core/lib/Drupal/Core/Cache/CacheCollector.php
Implements \Drupal\Core\Cache\CacheCollectorInterface::set().
1 method overrides CacheCollector::lazyLoadCache()
AliasWhitelist::lazyLoadCache in core/modules/path_alias/src/AliasWhitelist.php
Loads the cache if not already done.

File

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

Class

CacheCollector
Default implementation for CacheCollectorInterface.

Namespace

Drupal\Core\Cache

Code

protected function lazyLoadCache() {
  if ($this->cacheLoaded) {
    return;
  }

  // The cache was not yet loaded, set flag to TRUE.
  $this->cacheLoaded = TRUE;
  if ($cache = $this->cache
    ->get($this
    ->getCid())) {
    $this->cacheCreated = $cache->created;
    $this->storage = $cache->data;
  }
}