function variable_store_list_all in Variable 7
Same name and namespace in other branches
- 7.2 variable_store/variable_store.module \variable_store_list_all()
List all variable names from a realm.
Parameters
$realm: Realm name to list. NULL to list all realms.
$key: Realm key to list. NULL to list all realm keys.
Return value
array List of variable names.
File
- variable_store/
variable_store.module, line 94 - Variable API module - Database storage
Code
function variable_store_list_all($realm, $key = NULL) {
$query = db_select('variable_store', 'vs')
->fields('vs', array(
'name',
))
->distinct();
if ($realm) {
$query
->condition('realm', $realm);
}
if ($key) {
$query
->condition('realm_key', $key);
}
return $query
->execute()
->fetchCol();
}