function CacheTagsChecksumTrait::registerCacheTagsForPreload

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Cache/CacheTagsChecksumTrait.php \Drupal\Core\Cache\CacheTagsChecksumTrait::registerCacheTagsForPreload()

Implements \Drupal\Core\Cache\CacheTagsChecksumPreloadInterface::registerCacheTagsForPreload()

File

core/lib/Drupal/Core/Cache/CacheTagsChecksumTrait.php, line 191

Class

CacheTagsChecksumTrait
A trait for cache tag checksum implementations.

Namespace

Drupal\Core\Cache

Code

public function registerCacheTagsForPreload(array $cache_tags) : void {
  if (empty($cache_tags)) {
    return;
  }
  // Don't preload delayed tags that are awaiting invalidation.
  $preloadable_tags = array_diff($cache_tags, $this->delayedTags);
  if ($preloadable_tags) {
    $this->preloadTags = array_merge($this->preloadTags, $preloadable_tags);
  }
}

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