You are here

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

Return a list of existing keys.

Parameters

array|NULL $keys: A list of keys which should be checked.

Overrides AuthcacheP13nKeyValueStoreInterface::getKeys

File

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

Class

AuthcacheP13nDatabaseKeyValueStore
Database based implementation of key-value store.

Code

public function getKeys($keys = NULL) {
  if ($keys === array()) {
    return array();
  }
  $query = db_select(static::$tableName, 'kv')
    ->fields('kv', array(
    'name',
  ))
    ->condition('collection', $this->collectionName);
  if ($keys !== NULL) {
    $query
      ->condition('name', $keys);
  }
  return $query
    ->execute()
    ->fetchCol();
}