function fetchCampaignPlacement($start_date, $end_date)
 {
     $method = 'reports/campaign_placement.csv?start=' . date('Y-m-d', strtotime($start_date)) . '&end=' . date('Y-m-d', strtotime($start_date));
     $response = array();
     $response = parent::call($method, array());
     return $response;
 }
 public function fetchAll($type)
 {
     if (is_numeric($type)) {
         $type_code = $type;
     } else {
         $lower_type = strtolower($type);
         $map = array('dma' => 1, 'connection speed' => 2, 'isp' => 3, 'browser' => 4, 'os' => 5, 'geography' => 7, 'mathselect250' => 8);
         $type_code = $map[$lower_type] ? $map[$lower_type] : 0;
     }
     return $this->cleanResponse(parent::call($this->method . '/' . $type_code . '?with=target_values', array('xml_priority' => 'attribute')));
 }
 public function delete($args)
 {
     $args['status'] = 'off';
     return parent::modify($args);
 }
 public function fetchAllDetail($args = array())
 {
     if (!$args['page_limit'] || $args['page_limit'] > 100) {
         $args['page_limit'] = 100;
     }
     $all_items = false;
     if (!isset($args['page_offset'])) {
         $args['page_offset'] = 0;
         $all_items = true;
     }
     if (!isset($args['sort_by'])) {
         $args['sort_by'] = 'id';
     }
     $args_str = '';
     foreach ($args as $key => $val) {
         $args_str .= '&' . $key . '=' . urlencode($val);
     }
     $response = array();
     if (self::$_filter) {
         $filter = array();
         $filter = self::$_filter;
         $filter_prefix = '';
         if ($this->parent && $filter['type'] != $this->parent) {
             $filter_prefix = $this->getFilterPrefix($this->parent, $filter['type']);
         }
         $response = $this->call($this->method . '/limit/' . $filter_prefix . $filter['type'] . '=' . $filter['id'] . '?full=' . $this->method_full . $args_str, array());
         if (!$filter['persist']) {
             self::$_filter = array();
         }
     } else {
         $response = $this->call($this->method . '?full=' . $this->method_full . $args_str, array());
     }
     $full_count = $response['entities_attr']['count'];
     if (self::$_debug_level >= 1) {
         print "API->" . get_class($this) . "->fetchAllDetail = " . print_r($response, true) . "\n";
     }
     $ret = array();
     $ret = $this->prepareResponseMultiple($response);
     if ($all_items && count($ret['entities']) == $args['page_limit']) {
         do {
             $ret2 = array();
             $args['page_offset'] += $args['page_limit'];
             $ret2 = $this->fetchAllDetail($args);
             foreach ($ret2['entities'] as $eid => $e) {
                 $ret['entities'][$eid] = $e;
             }
         } while (count($ret['entities']) < $full_count);
     }
     return $ret;
 }