You are here

function message_realm_load_multiple_by_message in Message 6

Get realm messages by their ID.

Parameters

$message_id: The message ID.

Return value

Array keyed by the message realm and the realm Id as the value.

2 calls to message_realm_load_multiple_by_message()
message_show_message in ./message.module
Show a message by the message instance ID.
message_show_message_access in ./message.module

File

./message.module, line 441
API functions to manipulate messages.

Code

function message_realm_load_multiple_by_message($message_id) {
  static $messages = array();
  if (!isset($messages[$message_id])) {
    $result = db_query("SELECT * FROM {message_realm} WHERE iid = %d", $message_id);
    while ($row = db_fetch_object($result)) {
      $messages[$message_id][$row->realm][$row->realm_id] = $row->realm_id;
    }
  }
  return !empty($messages[$message_id]) ? $messages[$message_id] : array();
}