class DatabaseStorageExpirable in Service Container 7.2
Same name in this branch
- 7.2 src/KeyValueStore/DatabaseStorageExpirable.php \Drupal\service_container\KeyValueStore\DatabaseStorageExpirable
- 7.2 lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php \Drupal\Core\KeyValueStore\DatabaseStorageExpirable
Same name and namespace in other branches
- 7 src/KeyValueStore/DatabaseStorageExpirable.php \Drupal\service_container\KeyValueStore\DatabaseStorageExpirable
Overrides the KV store from Drupal to call MergeQuery::key instead of ::keys.
@codeCoverageIgnore
Hierarchy
- class \Drupal\Core\KeyValueStore\StorageBase implements KeyValueStoreInterface
- class \Drupal\Core\KeyValueStore\DatabaseStorage
- class \Drupal\Core\KeyValueStore\DatabaseStorageExpirable implements DestructableInterface, KeyValueStoreExpirableInterface
- class \Drupal\service_container\KeyValueStore\DatabaseStorageExpirable
- class \Drupal\Core\KeyValueStore\DatabaseStorageExpirable implements DestructableInterface, KeyValueStoreExpirableInterface
- class \Drupal\Core\KeyValueStore\DatabaseStorage
Expanded class hierarchy of DatabaseStorageExpirable
File
- src/
KeyValueStore/ DatabaseStorageExpirable.php, line 15 - Contains \Drupal\service_container\KeyValueStore\DatabaseStorageExpirable.
Namespace
Drupal\service_container\KeyValueStoreView source
class DatabaseStorageExpirable extends \Drupal\Core\KeyValueStore\DatabaseStorageExpirable {
/**
* {@inheritdoc}
*/
function setWithExpire($key, $value, $expire) {
// We are already writing to the table, so perform garbage collection at
// the end of this request.
$this->needsGarbageCollection = TRUE;
$this->connection
->merge($this->table)
->key(array(
'name' => $key,
'collection' => $this->collection,
))
->fields(array(
'value' => $this->serializer
->encode($value),
'expire' => REQUEST_TIME + $expire,
))
->execute();
}
}