You are here

function messaging_load_user in Messaging 5

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

Helper user loading function with static caching

1 call to messaging_load_user()
messaging_store_unpack in ./messaging.store.inc
Unpack stored messages

File

./messaging.module, line 962

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];
}