You are here

function ChainedStorageExpirable::setWithExpire in Supercache 8

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

Saves a value for a given key with a time to live.

Parameters

string $key: The key of the data to store.

mixed $value: The data to store.

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

Overrides DatabaseStorageExpirable::setWithExpire

1 call to ChainedStorageExpirable::setWithExpire()
ChainedStorageExpirable::setMultipleWithExpire in src/KeyValueStore/ChainedStorageExpirable.php
Saves an array of values with a time to live.

File

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

Class

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

Namespace

Drupal\supercache\KeyValueStore

Code

function setWithExpire($key, $value, $expire) {
  $this->cache
    ->set($key, $value, REQUEST_TIME + $expire);
  parent::setWithExpire($key, $value, $expire);
}