DatabaseStorageExpirable::setMultipleWithExpire

DatabaseStorageExpirable::setMultipleWithExpire(array $data, $expire)

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 KeyValueStoreExpirableInterface::setMultipleWithExpire

File

core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php, line 107

Class

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

Namespace

Drupal\Core\KeyValueStore

Code

function setMultipleWithExpire(array $data, $expire) {
  foreach ($data as $key => $value) {
    $this->setWithExpire($key, $value, $expire);
  }
}
doc_Drupal
2016-10-29 09:00:00
Comments
Leave a Comment

Please login to continue.