You are here

public function DatabaseRawBackend::counterGetMultiple in Supercache 8

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

Get multiple counter values at once.

Parameters

array $cids: An array of cache id's to retrieve.

Overrides CacheRawBackendInterface::counterGetMultiple

See also

self::getCounter()

File

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

Class

DatabaseRawBackend
Defines a default cache implementation.

Namespace

Drupal\supercache\Cache

Code

public function counterGetMultiple(array &$cids) {
  $results = $this
    ->getMultiple($cids);
  $counters = [];
  foreach ($results as $cid => $item) {
    $counters[$cid] = (int) $item->data;
  }
  return $counters;
}