function og_get_user_roles_name in Organic groups 7.2
Same name and namespace in other branches
- 7 og.module \og_get_user_roles_name()
Get the role names of role IDs.
Parameters
$rids: Array with role IDs.
Return value
Array keyed by the role ID, and the role name as the value.
1 call to og_get_user_roles_name()
- og_rules_group_roles_options_list in ./
og.rules.inc - Options list callback for group roles.
File
- ./
og.module, line 2989 - Enable users to create and manage groups with roles and permissions.
Code
function og_get_user_roles_name($rids = array()) {
if ($rids) {
$query = db_query("SELECT rid, name FROM {og_role} WHERE rid IN (:rids)", array(
':rids' => $rids,
));
}
else {
$query = db_query("SELECT rid, name FROM {og_role}");
}
return $query
->fetchAllKeyed();
}