You are here

function messaging_load_user in Messaging 6.2

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.3 messaging.module \messaging_load_user()

Helper user loading function with static caching

3 calls to messaging_load_user()
messaging_privatemsg_send_msg in messaging_privatemsg/messaging_privatemsg.module
Send mail message to user accounts
messaging_store_unpack in ./messaging.store.inc
Unpack stored messages
messaging_token_values in ./messaging.module
Implementation of hook_token_values()

File

./messaging.module, line 857

Code

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