function privatemsg_roles_load_multiple in Privatemsg 7.2
Same name and namespace in other branches
- 6.2 privatemsg_roles/privatemsg_roles.module \privatemsg_roles_load_multiple()
- 7 privatemsg_roles/privatemsg_roles.module \privatemsg_roles_load_multiple()
Load a number of roles based on their rid.
1 call to privatemsg_roles_load_multiple()
- privatemsg_roles_write_access in privatemsg_roles/
privatemsg_roles.module - Write permission check for roles recipients.
2 string references to 'privatemsg_roles_load_multiple'
- hook_privatemsg_recipient_type_info in ./
privatemsg.api.php - This hook is used to tell privatemsg about the recipient types defined by a module. Each type consists of an array keyed by the internal recipient type name and the following keys must be defined.
- privatemsg_roles_privatemsg_recipient_type_info in privatemsg_roles/
privatemsg_roles.module - Implements hook_privatemsg_recipient_type_info().
File
- privatemsg_roles/
privatemsg_roles.module, line 89 - Allows to send messages to all members of a role.
Code
function privatemsg_roles_load_multiple($rids, $type) {
$result = db_query("SELECT name, rid AS recipient FROM {role} WHERE rid IN (:rids)", array(
':rids' => $rids,
));
$roles = array();
foreach ($result as $role) {
$role->type = 'role';
$roles[privatemsg_recipient_key($role)] = $role;
}
return $roles;
}