You are here

function ChainedStorageExpirable::setMultipleWithExpire in Supercache 2.0.x

Same name and namespace in other branches
  1. 8 src/KeyValueStore/ChainedStorageExpirable.php \Drupal\supercache\KeyValueStore\ChainedStorageExpirable::setMultipleWithExpire()

Saves an array of values with a time to live.

Parameters

array $data: An array of data to store.

int $expire: The time to live for items, in seconds.

Overrides DatabaseStorageExpirable::setMultipleWithExpire

File

src/KeyValueStore/ChainedStorageExpirable.php, line 143
Contains \Drupal\supercache\KeyValueStore\ChainedStorageExpirable.

Class

ChainedStorageExpirable
Defines a default key/value store implementation for expiring items.

Namespace

Drupal\supercache\KeyValueStore

Code

function setMultipleWithExpire(array $data, $expire) {
  foreach ($data as $key => $value) {
    $this
      ->setWithExpire($key, $value, $expire);
  }
}