You are here

function cc::clear_contacts in Constant Contact 6.2

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

* Be careful with this method :) * You can use this to clear all contacts from a specific set of contact lists * * *

Parameters

array An array of contact list ID's to clear of contacts: * * @access public

File

./class.cc.php, line 910

Class

cc
@file

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');
  $this
    ->load_url("activities", 'post', $params, 201);
  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;
}