function CacheTagsChecksumDecorator::invalidateTags

Same name and namespace in other branches
  1. 10 core/modules/system/tests/modules/performance_test/src/Cache/CacheTagsChecksumDecorator.php \Drupal\performance_test\Cache\CacheTagsChecksumDecorator::invalidateTags()

Overrides CacheTagsInvalidatorInterface::invalidateTags

File

core/modules/system/tests/modules/performance_test/src/Cache/CacheTagsChecksumDecorator.php, line 54

Class

CacheTagsChecksumDecorator
Wraps an existing cache tags checksum invalidator to track calls separately.

Namespace

Drupal\performance_test\Cache

Code

public function invalidateTags(array $tags) {
    // If there are no cache tags, there is nothing to invalidate, and the
    // decorated method will be a no-op, so don't log anything.
    if (empty($tags)) {
        return $this->checksumInvalidator
            ->invalidateTags($tags);
    }
    $start = microtime(TRUE);
    $return = $this->checksumInvalidator
        ->invalidateTags($tags);
    $stop = microtime(TRUE);
    $this->logCacheTagOperation($tags, $start, $stop, CacheTagOperation::InvalidateTags);
    return $return;
}

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