You are here

function privatemsg_user_load_multiple in Privatemsg 7.2

Same name and namespace in other branches
  1. 7 privatemsg.module \privatemsg_user_load_multiple()

Privatemsg wrapper function for user_load_multiple().

The function adds the privatemsg specific recipient id (uid) and recipient type to the user object.

Parameters

$uid: Which uid to load. Can either be a single id or an array of uids.

Return value

If existing for the passed in uid, the user object with the recipient and type properties.

3 calls to privatemsg_user_load_multiple()
pm_block_user_privatemsg_block_message in pm_block_user/pm_block_user.module
Implements hook_privatemsg_block_message.
privatemsg_filter_create_get_query in privatemsg_filter/privatemsg_filter.module
Creates a GET query based on the selected filters.
_privatemsg_generate_user_array in ./privatemsg.module
Generate array of user objects based on a string.
1 string reference to 'privatemsg_user_load_multiple'
privatemsg_privatemsg_recipient_type_info in ./privatemsg.module
Implements hook_privatemsg_recipient_type_info().

File

./privatemsg.module, line 2531
Allows users to send private messages to other users.

Code

function privatemsg_user_load_multiple($uids) {
  $accounts = array();
  foreach (user_load_multiple($uids) as $account) {
    $account->recipient = $account->uid;
    $account->type = 'user';
    $accounts[privatemsg_recipient_key($account)] = $account;
  }
  return $accounts;
}