Export/Formatter/CSVListFormatter.php
protected function prepareHeaders($output)
    {
        $keys = $this->exportManager->getExport($this->exportAlias)->getQueryKeys($this->exportData);
        // we want to keep the order of the first row. So we will iterate on the first row of the results
        $first_row = count($this->result) > 0 ? $this->result[0] : array();
        $header_line = array();
        
        if ($this->formatterData['numerotation'] === true) {
                $header_line[] = $this->translator->trans('Number');
        }
        
        foreach ($first_row as $key => $value) {
            $header_line[] = $this->getLabel($key, '_header');
        }
        
        if (count($header_line) > 0) {
            fputcsv($output, $header_line);
        }
    }
protected function prepareHeaders($output)
    {
        $keys = $this->exportManager->getExport($this->exportAlias)->getQueryKeys($this->exportData);
        // we want to keep the order of the first row. So we will iterate on the first row of the results
        $first_row = count($this->result) > 0 ? $this->result[0] : array();
        $header_line = array();
        
        if ($this->formatterData['numerotation'] === true) {
                $header_line[] = $this->translator->trans('Number');
        }
        
        foreach ($first_row as $key => $value) {
            $header_line[] = $this->getLabel($key, '_header');
        }
        
        if (count($header_line) > 0) {
            fputcsv($output, $header_line);
        }
    }
protected function prepareHeaders ( $ output ) { $ keys = $ this -> exportManager -> getExport ( $ this -> exportAlias ) -> getQueryKeys ( $ this -> exportData ) ; // we want to keep the order of the first row. So we will iterate on the first row of the results $ first_row = count ( $ this -> result ) > 0 ? $ this -> result [ 0 ] : array ( ) ; $ header_line = array ( ) ; if ( $ this -> formatterData [ 'numerotation' ] === true ) { $ header_line [ ] = $ this -> translator -> trans ( 'Number' ) ; } foreach ( $ first_row as $ key => $ value ) { $ header_line [ ] = $ this -> getLabel ( $ key , '_header' ) ; } if ( count ( $ header_line ) > 0 ) { fputcsv ( $ output , $ header_line ) ; } }
add the headers to the csv file

@param resource $output
add the headers to the csv file