You are here

function _mailchimp_get_required_lists in Mailchimp 6.2

Same name and namespace in other branches
  1. 5.2 mailchimp.module \_mailchimp_get_required_lists()
  2. 5 mailchimp.module \_mailchimp_get_required_lists()
  3. 6 mailchimp.module \_mailchimp_get_required_lists()
  4. 7 mailchimp.module \_mailchimp_get_required_lists()

Get all of the lists that the given user must be subscribed to

2 calls to _mailchimp_get_required_lists()
mailchimp_cron in ./mailchimp.module
Implementation of hook_cron.
mailchimp_user in ./mailchimp.module
Implementation of hook_user

File

./mailchimp.module, line 1040
Mailchimp module.

Code

function _mailchimp_get_required_lists() {
  $lists = variable_get('mailchimp_lists', array());
  if (!is_array($lists)) {
    $lists = array();
  }
  else {
    if (!empty($lists)) {
      foreach ($lists as $key => $list) {
        if ($list->listtype !== MAILCHIMP_LISTTYPE_REQUIRED) {
          unset($lists[$key]);
        }
      }
    }
  }
  return $lists;
}