You are here

public function KeyValueDatabaseExpirableFactory::garbageCollection in Service Container 7

Same name and namespace in other branches
  1. 7.2 lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php \Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory::garbageCollection()

Deletes expired items.

File

lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php, line 66
Contains \Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory.

Class

KeyValueDatabaseExpirableFactory
Defines the key/value store factory for the database backend.

Namespace

Drupal\Core\KeyValueStore

Code

public function garbageCollection() {
  $this->connection
    ->delete('key_value_expire')
    ->condition('expire', REQUEST_TIME, '<')
    ->execute();
}