You are here

public function DatabaseRawBackend::counterMultiple in Supercache 8

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

Add an increment (can be negative) to the stored cache data. Only works for stored numeric data.

Parameters

string[] $cide: The cache ID or array of ID's.

int $increment: The amount to increment or decrement.

int $default: Default value.

Overrides CacheRawBackendInterface::counterMultiple

File

src/Cache/DatabaseRawBackend.php, line 416
Contains \Drupal\supercache\Cache\DatabaseRawBackend.

Class

DatabaseRawBackend
Defines a default cache implementation.

Namespace

Drupal\supercache\Cache

Code

public function counterMultiple(array $cids, $increment, $default = 0) {

  // TODO: This can be implemented in a batched way (with just one query)
  // and counter() should call counterMultiple(). But again the crippled
  // Drupal's DTBNG is brilliantly doing it's job.
  foreach ($cids as $cid) {
    $this
      ->counter($cid, $increment, $default);
  }
}