You are here

public function CacheTagsChecksumMongodb::getCurrentChecksum in MongoDB 8

Returns the sum total of validations for a given set of tags.

Called by a backend when storing a cache item.

Parameters

string[] $tags: Array of cache tags.

Return value

string Cache tag invalidations checksum.

Overrides CacheTagsChecksumInterface::getCurrentChecksum

File

src/CacheTagsChecksumMongodb.php, line 67
Contains \Drupal\mongodb\CacheTagsChecksumMongodb.

Class

CacheTagsChecksumMongodb

Namespace

Drupal\mongodb

Code

public function getCurrentChecksum(array $tags) {

  // Remove tags that were already invalidated during this request from the
  // static caches so that another invalidation can occur later in the same
  // request. Without that, written cache items would not be invalidated
  // correctly.
  foreach ($tags as $tag) {
    unset($this->invalidatedTags[$tag]);
  }
  return $this
    ->calculateChecksum($tags);
}