You are here

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

Return an associative array of entries for the given keys.

Parameters

array $keys: A list of strings.

Overrides AuthcacheP13nKeyValueStoreInterface::get

1 call to AuthcacheP13nDatabaseKeyValueStore::get()
AuthcacheP13nDatabaseKeyValueStore::getOne in modules/authcache_p13n/includes/AuthcacheP13nDatabaseKeyValueStore.inc
Return the value from the collection for the given key.

File

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

Class

AuthcacheP13nDatabaseKeyValueStore
Database based implementation of key-value store.

Code

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