You are here

function mailing_list_get in Mailing List 7

Returns a list of all mailing lists keyed by the mlid

Parameters

$mlid: If provided, only get the list with the specified mlid.

Return value

array

4 calls to mailing_list_get()
mailing_list_block_info in ./mailing_list.module
Implement hook_block_info();
mailing_list_forms in ./mailing_list.module
Implement hook_forms().
mailing_list_lists in ./mailing_list.admin.inc
Menu callback; displays all mailing lists in a table.
mailing_list_load in ./mailing_list.module
Return the mailing list object matching a mailing list ID.

File

./mailing_list.module, line 232
Minimalistic mailing list module.

Code

function mailing_list_get($mlid = NULL) {
  $query = db_select('mailing_list', 'ml')
    ->fields('ml');
  if ($mlid) {
    $query
      ->condition('mlid', $mlid);
  }
  return $query
    ->execute()
    ->fetchAllAssoc('mlid');
}