original_string: 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);
          }
      }
code: 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);
          }
      }
code_tokens: 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 ) ; } }
docstring: add the headers to the csv file
  
  @param resource $output
docstring_tokens: add the headers to the csv file