You are here

function key_get_keys_by_type in Key 7.3

Get keys that use the specified key type.

Parameters

string $key_type_id: The key type ID to use.

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.

1 call to key_get_keys_by_type()
key_get_key_names_as_options in ./key.module
Gets all key configurations as options, for use in forms.

File

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

Code

function key_get_keys_by_type($key_type_id, $reset = FALSE) {
  $filtered_keys = array();
  $keys = key_get_keys($reset);
  foreach ($keys as $id => $key) {
    if ($key['key_type'] == $key_type_id) {
      $filtered_keys[$id] = $key;
    }
  }
  return $filtered_keys;
}