public function exportRecords(
        $format = 'php',
        $type = 'flat',
        $recordIds = null,
        $fields = null,
        $forms = null,
        $events = null,
        $filterLogic = null,
        $rawOrLabel = 'raw',
        $rawOrLabelHeaders = 'raw',
        $exportCheckboxLabel = false,
        $exportSurveyFields = false,
        $exportDataAccessGroups = false
    ) {
        $data = array(
                'token'        => $this->apiToken,
                'content'      => 'record',
                'returnFormat' => 'json'
        );
        
        #---------------------------------------
        # Process the arguments
        #---------------------------------------
        $legalFormats = array('php', 'csv', 'json', 'xml', 'odm');
        $data['format'] = $this->processFormatArgument($format, $legalFormats);
        
        $data['type']    = $this->processTypeArgument($type);
        $data['records'] = $this->processRecordIdsArgument($recordIds);
        $data['fields']  = $this->processFieldsArgument($fields);
        $data['forms']   = $this->processFormsArgument($forms);
        $data['events']  = $this->processEventsArgument($events);
        
        $data['rawOrLabel']             = $this->processRawOrLabelArgument($rawOrLabel);
        $data['rawOrLabelHeaders']      = $this->processRawOrLabelHeadersArgument($rawOrLabelHeaders);
        $data['exportCheckboxLabel']    = $this->processExportCheckboxLabelArgument($exportCheckboxLabel);
        $data['exportSurveyFields']     = $this->processExportSurveyFieldsArgument($exportSurveyFields);
        $data['exportDataAccessGroups'] = $this->processExportDataAccessGroupsArgument($exportDataAccessGroups);
        
        $data['filterLogic'] = $this->processFilterLogicArgument($filterLogic);
        
        #---------------------------------------
        # Get the records and process them
        #---------------------------------------
        $records = $this->connection->callWithArray($data);
        $records = $this->processExportResult($records, $format);
      
        return $records;
    }