function DatabaseStorage::deleteMultiple

Same name in other branches
  1. 9 core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php \Drupal\Core\KeyValueStore\DatabaseStorage::deleteMultiple()
  2. 8.9.x core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php \Drupal\Core\KeyValueStore\DatabaseStorage::deleteMultiple()
  3. 11.x core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php \Drupal\Core\KeyValueStore\DatabaseStorage::deleteMultiple()

Overrides KeyValueStoreInterface::deleteMultiple

1 call to DatabaseStorage::deleteMultiple()
DatabaseStorageExpirable::deleteMultiple in core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php
Deletes multiple items from the key/value store.
1 method overrides DatabaseStorage::deleteMultiple()
DatabaseStorageExpirable::deleteMultiple in core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php
Deletes multiple items from the key/value store.

File

core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php, line 220

Class

DatabaseStorage
Defines a default key/value store implementation.

Namespace

Drupal\Core\KeyValueStore

Code

public function deleteMultiple(array $keys) {
    // Delete in chunks when a large array is passed.
    while ($keys) {
        try {
            $this->connection
                ->delete($this->table)
                ->condition('name', array_splice($keys, 0, 1000), 'IN')
                ->condition('collection', $this->collection)
                ->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.