You are here

function cc::get_all_lists in Constant Contact 7.3

Same name and namespace in other branches
  1. 6.3 class.cc.php \cc::get_all_lists()

Gets all the contact lists for the CC account If more than one page exists we grab them too Second argument can be used to show/hide the do-not-mail etc lists This method also sorts the lists based on the SortOrder field

@access public

File

./class.cc.php, line 323
Constant Contact PHP Class

Class

cc
@file Constant Contact PHP Class

Code

function get_all_lists($action = 'lists', $exclude = 3, $callback = '') {
  $lists = $this
    ->get_lists($action, $exclude);
  if (count($lists) > 0) {
    if (isset($this->list_meta_data->next_page) && !is_null($this->list_meta_data->next_page)) {

      // grab all the other pages if they exist
      while (!is_null($this->list_meta_data->next_page)) {
        $lists = array_merge($lists, $this
          ->get_lists($this->list_meta_data->next_page, 0));
      }
    }
    $callback = $callback ? $callback : array(
      "cc",
      "sort_lists",
    );
    if (is_array($lists)) {
      usort($lists, $callback);
    }
  }
  return $lists;
}