function privatemsg_message_load

1 privatemsg.module privatemsg_message_load($pmid, $account = NULL)
7-1 privatemsg.module privatemsg_message_load($pmid, $account = NULL)
7-2 privatemsg.module privatemsg_message_load($pmid, $account = NULL)
6-2 privatemsg.module privatemsg_message_load($pmid, $account = NULL, $reset = FALSE)

Load a single message.

Parameters

$pmid: Message id, pm.mid field

$account: For which account the message should be loaded. Defaults to the current user.

Related topics

7 calls to privatemsg_message_load()

File

./privatemsg.module, line 2029
Allows users to send private messages to other users.

Code

function privatemsg_message_load($pmid, $account = NULL) {
  // If $pmid is object or array - do nothing
  // (fixing conflict with message_load() function in message module).
  if (is_array($pmid) || is_object($pmid)) {
    return NULL;
  }
  $conditions = array();
  if ($account) {
    $conditions['account'] = $account;
  }
  $messages = privatemsg_message_load_multiple(array($pmid), $conditions);
  return current($messages);
}