public function DatabaseCacheTagsChecksum::getCurrentChecksum

public DatabaseCacheTagsChecksum::getCurrentChecksum(array $tags)

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

core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php, line 78

Class

DatabaseCacheTagsChecksum
Cache tags invalidations checksum implementation that uses the database.

Namespace

Drupal\Core\Cache

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);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Cache!DatabaseCacheTagsChecksum.php/function/DatabaseCacheTagsChecksum::getCurrentChecksum/8.1.x