CacheCollector::lazyLoadCache

protected CacheCollector::lazyLoadCache()

Loads the cache if not already done.

File

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

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;
  }
}
doc_Drupal
2016-10-29 08:49:23
Comments
Leave a Comment

Please login to continue.