You are here

function cc::get_list in Constant Contact 7.3

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

Gets the details of a specific constant list.

@access public

File

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

Class

cc
@file Constant Contact PHP Class

Code

function get_list($listid) {
  $xml = $this
    ->load_url("lists/{$listid}");
  if (!$xml) {
    return FALSE;
  }
  $list = FALSE;
  $_list = isset($xml['entry']) ? $xml['entry'] : FALSE;

  // parse into nicer array
  if (is_array($_list)) {
    $id = $this
      ->get_id_from_link($_list['link_attr']['href']);
    $list = array(
      'id' => $id,
      'Name' => $_list['content']['ContactList']['Name'],
      'ShortName' => $_list['content']['ContactList']['ShortName'],
      'OptInDefault' => $_list['content']['ContactList']['OptInDefault'],
      'SortOrder' => $_list['content']['ContactList']['SortOrder'],
    );
  }
  return $list;
}