You are here

function maillog_maillog_load in Maillog / Mail Developer 7

Same name and namespace in other branches
  1. 6 maillog.module \maillog_maillog_load()

Load a maillog record.

Parameters

int $id: The primary ID for a Maillog record.

Return value

null|array An array containing the {maillog} record if found, NULL if not.

File

./maillog.module, line 104
Primary hook implementations for the Maillog module.

Code

function maillog_maillog_load($id) {
  $result = db_query("SELECT id, header_from, header_to, header_reply_to, header_all, subject, body FROM {maillog} WHERE id=:id", array(
    ':id' => $id,
  ));
  if ($result == FALSE) {
    $maillog = NULL;
  }
  else {
    $maillog = $result
      ->fetchAssoc();

    // Unserialize values.
    $maillog['header_all'] = unserialize($maillog['header_all']);
  }
  return $maillog;
}