You are here

function mailhandler_mailbox_load in Mailhandler 6

Same name and namespace in other branches
  1. 6.2 mailhandler.module \mailhandler_mailbox_load()
  2. 7.2 mailhandler.module \mailhandler_mailbox_load()
  3. 7 mailhandler.module \mailhandler_mailbox_load()

Load a mailbox array from database.

Return a mailbox information based on the ID passed as parameter.

Parameters

$mid: Int mailbox ID to load

$conditions: An associative array of conditions on the {mailhandler} table, where the keys are the database fields and the values are the values those fields must have.

$reset: Whether to reset the internal mailhandler_mailbox_load cache. Unimplemented to make module versions easy to maintain.

Return value

Array of mailbox configuration

Related topics

1 call to mailhandler_mailbox_load()
mailhandler_get_mailbox in ./mailhandler.module
(DEPRECATED) Fetch data for a specific mailbox from the database.

File

./mailhandler.module, line 213
Mailhandler module code.

Code

function mailhandler_mailbox_load($mid, $conditions = array(), $reset = FALSE) {

  // Convert single mid to array for load multiple calls.
  $mids = isset($mid) ? array(
    $mid,
  ) : array();

  // Load the mailbox information.
  $mailbox = mailhandler_mailbox_load_multiple($mids, $conditions, $reset);

  // Record debug information.
  mailhandler_watchdog_record('Mailbox loaded: @mailbox', array(
    '@mailbox' => var_export($mailbox, TRUE),
  ), WATCHDOG_DEBUG);

  // return the mailbox or FALSE.
  return $mailbox ? (array) reset($mailbox) : FALSE;
}