function KeyValueDatabaseExpirableFactory::garbageCollection
Same name in other branches
- 9 core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php \Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory::garbageCollection()
- 8.9.x core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php \Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory::garbageCollection()
- 10 core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php \Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory::garbageCollection()
Deletes expired items.
File
-
core/
lib/ Drupal/ Core/ KeyValueStore/ KeyValueDatabaseExpirableFactory.php, line 51
Class
- KeyValueDatabaseExpirableFactory
- Defines the key/value store factory for the database backend.
Namespace
Drupal\Core\KeyValueStoreCode
public function garbageCollection() {
try {
$this->connection
->delete('key_value_expire')
->condition('expire', $this->time
->getRequestTime(), '<')
->execute();
} catch (\Exception $e) {
$this->catchException($e);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.