You are here

public function StaticFileCacheBackend::fetch in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/FileCache/StaticFileCacheBackend.php \Drupal\Tests\Component\FileCache\StaticFileCacheBackend::fetch()

Fetches data from the cache backend.

Parameters

array $cids: The cache IDs to fetch.

Return value

array An array containing cache entries keyed by cache ID.

Overrides FileCacheBackendInterface::fetch

File

core/tests/Drupal/Tests/Component/FileCache/StaticFileCacheBackend.php, line 44
Contains \Drupal\Tests\Component\FileCache\StaticFileCacheBackend.

Class

StaticFileCacheBackend
Allows to cache data based on file modification dates in a static cache.

Namespace

Drupal\Tests\Component\FileCache

Code

public function fetch(array $cids) {
  $result = [];
  foreach ($cids as $cid) {
    if (isset(static::$cache[$this->bin][$cid])) {
      $result[$cid] = static::$cache[$this->bin][$cid];
    }
  }
  return $result;
}