You are here

protected function D8Cache::checksumValid in Drupal 8 Cache Backport 7

Returns whether the checksum is valid for the given cache tags.

Used when retrieving a cache item in a cache backend, to verify that no cache tag based invalidation happened.

Parameters

int $checksum: The checksum that was stored together with the cache item.

string[] $tags: The cache tags that were stored together with the cache item.

Return value

bool FALSE if cache tag invalidations happened for the passed in tags since the cache item was stored, TRUE otherwise.

1 call to D8Cache::checksumValid()
D8Cache::getMultiple in ./d8cache.cache.inc

File

./d8cache.cache.inc, line 286

Class

D8Cache
Defines a Drupal 8 cacheable metadata aware cache backend.

Code

protected function checksumValid($checksum, array $tags) {
  if (!$this
    ->ensureInstalled()) {

    // When the module has not been installed yet, assume all checksums are
    // valid.
    return TRUE;
  }
  return d8cache_cache_tags_is_valid($checksum, $tags);
}