You are here

protected function ChainedStorageTrait::populateMissingValuesLocal in Supercache 8

Same name and namespace in other branches
  1. 2.0.x src/KeyValueStore/ChainedStorageTrait.php \Drupal\supercache\KeyValueStore\ChainedStorageTrait::populateMissingValuesLocal()

To prevent database lookups we store a special 'empty' object.

Parameters

array $requested: The requested set of keys from getMultiple().

array $obtained: The effectively obtained key-value pairs.

2 calls to ChainedStorageTrait::populateMissingValuesLocal()
ChainedStorage::getMultiple in src/KeyValueStore/ChainedStorage.php
Returns the stored key/value pairs for a given set of keys.
ChainedStorageExpirable::getMultiple in src/KeyValueStore/ChainedStorageExpirable.php
Returns the stored key/value pairs for a given set of keys.

File

src/KeyValueStore/ChainedStorageTrait.php, line 47

Class

ChainedStorageTrait

Namespace

Drupal\supercache\KeyValueStore

Code

protected function populateMissingValuesLocal($requested, $obtained) {
  $missing = array_diff_key(array_flip($requested), $obtained);
  foreach ($missing as $key => $value) {
    $missing[$key] = $this->EMPTY_VALUE;
  }
  $this->cache
    ->setMultiple($this
    ->KeyValueToCache($missing));
}