You are here

public function AuthcacheP13nDatabaseKeyValueStore::delete in Authenticated User Page Caching (Authcache) 7.2

Remove entries with the given key. If keys is omitted, delete all entries.

Parameters

array $keys: A list of strings.

Overrides AuthcacheP13nKeyValueStoreInterface::delete

File

modules/authcache_p13n/includes/AuthcacheP13nDatabaseKeyValueStore.inc, line 86
Defines database based implementation of a key-value store.

Class

AuthcacheP13nDatabaseKeyValueStore
Database based implementation of key-value store.

Code

public function delete($keys = NULL) {
  if ($keys === array()) {
    return 0;
  }
  $query = db_delete(static::$tableName)
    ->condition('collection', $this->collectionName);
  if ($keys !== NULL) {
    $query
      ->condition('name', $keys);
  }
  return $query
    ->execute();
}