You are here

function messaging_message_load in Messaging 6

Same name and namespace in other branches
  1. 6.4 messaging.module \messaging_message_load()
  2. 6.2 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

2 calls to messaging_message_load()
Messaging_API_Tests::testMessagingBasicAPI in tests/messaging_api.test
Exercise basic API functions
messaging_notify_notifications in messaging_notify/messaging_notify.module
Implementation of hook_notifications()

File

./messaging.module, line 793

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