You are here

function messaging_load_user in Messaging 6.3

Same name and namespace in other branches
  1. 5 messaging.module \messaging_load_user()
  2. 6.4 messaging.module \messaging_load_user()
  3. 6 messaging.module \messaging_load_user()
  4. 6.2 messaging.module \messaging_load_user()

Helper user loading function with static caching

4 calls to messaging_load_user()
Messaging_Message::__construct in classes/messaging_message.class.inc
Constructor, with predefined array of data
messaging_privatemsg_send_msg in messaging_privatemsg/messaging_privatemsg.module
Send mail message to user accounts
messaging_store_unpack_message in ./messaging.store.inc
Unpack stored messages
messaging_token_values in ./messaging.module
Implementation of hook_token_values()

File

./messaging.module, line 601

Code

function messaging_load_user($uid) {
  $cache =& messaging_static(__FUNCTION__);
  if (!$cache || !array_key_exists($uid, $cache)) {
    $cache[$uid] = user_load(array(
      'uid' => $uid,
    ));
  }
  return $cache[$uid];
}