You are here

public function ChainedFastRawBackend::counterSetMultiple in Supercache 8

Same name and namespace in other branches
  1. 2.0.x src/Cache/ChainedFastRawBackend.php \Drupal\supercache\Cache\ChainedFastRawBackend::counterSetMultiple()

Set the value of counter variables in batch.

Parameters

array $items: An array of counter values, keyed by cid. In the form:

$items = array(
  $cid => $value,
);

Overrides CacheRawBackendInterface::counterSetMultiple

File

src/Cache/ChainedFastRawBackend.php, line 276
Contains \Drupal\supercache\Cache\ChainedFastRawBackend.

Class

ChainedFastRawBackend
Defines a backend with a fast and a consistent backend chain.

Namespace

Drupal\supercache\Cache

Code

public function counterSetMultiple(array $items) {
  foreach ($items as $cid => $item) {
    $this->consistentBackend
      ->set($cid, (int) $item);
    $this->fastBackend
      ->set($cid, (int) $item);
  }
  $this
    ->markAsOutdated();
}