public function DatabaseBackend::deleteTags

Implements Drupal\Core\Cache\CacheBackendInterface::deleteTags().

Overrides CacheBackendInterface::deleteTags

File

drupal/core/lib/Drupal/Core/Cache/DatabaseBackend.php, line 220
Definition of Drupal\Core\Cache\DatabaseBackend.

Class

DatabaseBackend
Defines a default cache implementation.

Namespace

Drupal\Core\Cache

Code

public function deleteTags(array $tags) {
  $tag_cache =& drupal_static('Drupal\\Core\\Cache\\CacheBackendInterface::tagCache', array());
  foreach ($this
    ->flattenTags($tags) as $tag) {
    unset($tag_cache[$tag]);
    try {
      $this->connection
        ->merge('cache_tags')
        ->insertFields(array(
        'deletions' => 1,
      ))
        ->expression('deletions', 'deletions + 1')
        ->key(array(
        'tag' => $tag,
      ))
        ->execute();
    } catch (\Exception $e) {
      $this
        ->catchException($e, 'cache_tags');
    }
  }
}