You are here

function key_get_keys_by_storage_method in Key 7.3

Get keys that use the specified storage method.

Parameters

string $storage_method: The storage method of the key provider.

bool $reset: A flag to force the configurations to be retrieved from the database.

Return value

array An array of keys indexed by their IDs.

File

./key.module, line 420
Main Key functionality and hook implementations.

Code

function key_get_keys_by_storage_method($storage_method, $reset = FALSE) {
  $filtered_keys = array();
  $keys = key_get_keys($reset);
  $providers = key_get_plugins('key_provider', TRUE, $reset);
  foreach ($keys as $id => $key) {
    if ($providers[$key['key_provider']]['storage method'] == $storage_method) {
      $filtered_keys[$id] = $key;
    }
  }
  return $filtered_keys;
}