You are here

function messaging_message_load in Messaging 6.2

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

Helper function for message loading from the store

Parameters

$mqid: Message id

1 call to messaging_message_load()
Messaging_API_Tests::testMessagingBasicAPI in tests/messaging_api.test
Exercise basic API functions

File

./messaging.module, line 872

Code

function messaging_message_load($mqid, $refresh = FALSE) {
  static $cache;
  if (!isset($cache[$mqid]) || $refresh) {
    if ($message = messaging_store('load', $mqid)) {
      $cache[$mqid] = $message;
    }
    else {
      $cache[$mqid] = FALSE;
    }
  }
  return $cache[$mqid];
}