Exemplo n.º 1
0
 public static function getCSVDataFromRecords($resultRecords, $uniqueHeaders, $print, $headers)
 {
     global $SEPARATOR;
     global $TEXT_QUALIFIER;
     #Fill in the data.
     $output = "";
     $outputArray = array();
     if ($headers) {
         $output = implode($SEPARATOR, $uniqueHeaders) . "\n";
         $outputArray[] = $output;
     }
     if ($print) {
         print $output;
         $output = "";
     }
     $records = ZuoraAPIHelper::getQueryResultsFromRecords($resultRecords, $uniqueHeaders);
     foreach ($records as $record) {
         $output = $TEXT_QUALIFIER . implode($TEXT_QUALIFIER . $SEPARATOR . $TEXT_QUALIFIER, $record) . $TEXT_QUALIFIER . "\n";
         $outputArray[] = $output;
         if ($print) {
             print $output;
             $output = "";
         }
     }
     return $outputArray;
 }