You are here

function cc::clear_contacts in Constant Contact 7.3

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

Clear all contacts.

Be careful with this method. You can use it to clear all contacts from a specific set of contact lists.

@access public

Parameters

array $lists: An array of contact list ID's to clear of contacts

File

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

Class

cc
@file Constant Contact PHP Class

Code

function clear_contacts($lists) {
  $params['activityType'] = 'CLEAR_CONTACTS_FROM_LISTS';
  $lists_string = '';
  if (is_array($lists)) {
    foreach ($lists as $id) {
      $params['lists'][] = $this
        ->get_list_url($id);
    }
  }
  $this
    ->http_set_content_type('application/x-www-form-urlencoded');
  $xml = $this
    ->load_url("activities", 'post', $params, 201);
  if ($xml) {
    return TRUE;
  }

  /*
  if(isset($this->http_response_headers['Location']) && trim($this->http_response_headers['Location']) != ''){
      return $this->get_id_from_link($this->http_response_headers['Location']);
  }
  */
  return FALSE;
}