You are here

protected function ChainedStorageTrait::CacheToKeyValue in Supercache 8

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

Converts a cache array to a KeyValue array.

Parameters

array $items:

Return value

array

4 calls to ChainedStorageTrait::CacheToKeyValue()
ChainedStorage::getMultiple in src/KeyValueStore/ChainedStorage.php
Returns the stored key/value pairs for a given set of keys.
ChainedStorage::has in src/KeyValueStore/ChainedStorage.php
Returns whether a given key exists in the store.
ChainedStorageExpirable::getMultiple in src/KeyValueStore/ChainedStorageExpirable.php
Returns the stored key/value pairs for a given set of keys.
ChainedStorageExpirable::has in src/KeyValueStore/ChainedStorageExpirable.php
Returns whether a given key exists in the store.

File

src/KeyValueStore/ChainedStorageTrait.php, line 82

Class

ChainedStorageTrait

Namespace

Drupal\supercache\KeyValueStore

Code

protected function CacheToKeyValue(array $items) {
  $result = array();
  foreach ($items as $key => $value) {
    if (is_object($value) && $value->data !== $this->EMPTY_VALUE) {
      $result[$key] = $value->data;
    }
  }
  return $result;
}