original_string: protected function renderDataTable($table, &$allColumns = array())
      {
          if ($table instanceof Simple) {
              $row = $table->getFirstRow();
              if ($row !== false) {
                  $columnNameToValue = $row->getColumns();
                  if (count($columnNameToValue) == 1) {
                      // simple tables should only have one column, the value
                      $allColumns['value'] = true;
  
                      $value = array_values($columnNameToValue);
                      $str = 'value' . $this->lineEnd . $this->formatValue($value[0]);
                      return $str;
                  }
              }
          }
  
          $csv = $this->makeArrayFromDataTable($table, $allColumns);
  
          // now we make sure that all the rows in the CSV array have all the columns
          foreach ($csv as &$row) {
              foreach ($allColumns as $columnName => $true) {
                  if (!isset($row[$columnName])) {
                      $row[$columnName] = '';
                  }
              }
          }
  
          $str = $this->buildCsvString($allColumns, $csv);
          return $str;
      }
code: protected function renderDataTable($table, &$allColumns = array())
      {
          if ($table instanceof Simple) {
              $row = $table->getFirstRow();
              if ($row !== false) {
                  $columnNameToValue = $row->getColumns();
                  if (count($columnNameToValue) == 1) {
                      // simple tables should only have one column, the value
                      $allColumns['value'] = true;
  
                      $value = array_values($columnNameToValue);
                      $str = 'value' . $this->lineEnd . $this->formatValue($value[0]);
                      return $str;
                  }
              }
          }
  
          $csv = $this->makeArrayFromDataTable($table, $allColumns);
  
          // now we make sure that all the rows in the CSV array have all the columns
          foreach ($csv as &$row) {
              foreach ($allColumns as $columnName => $true) {
                  if (!isset($row[$columnName])) {
                      $row[$columnName] = '';
                  }
              }
          }
  
          $str = $this->buildCsvString($allColumns, $csv);
          return $str;
      }
code_tokens: protected function renderDataTable ( $ table , & $ allColumns = array ( ) ) { if ( $ table instanceof Simple ) { $ row = $ table -> getFirstRow ( ) ; if ( $ row !== false ) { $ columnNameToValue = $ row -> getColumns ( ) ; if ( count ( $ columnNameToValue ) == 1 ) { // simple tables should only have one column, the value $ allColumns [ 'value' ] = true ; $ value = array_values ( $ columnNameToValue ) ; $ str = 'value' . $ this -> lineEnd . $ this -> formatValue ( $ value [ 0 ] ) ; return $ str ; } } } $ csv = $ this -> makeArrayFromDataTable ( $ table , $ allColumns ) ; // now we make sure that all the rows in the CSV array have all the columns foreach ( $ csv as & $ row ) { foreach ( $ allColumns as $ columnName => $ true ) { if ( ! isset ( $ row [ $ columnName ] ) ) { $ row [ $ columnName ] = '' ; } } } $ str = $ this -> buildCsvString ( $ allColumns , $ csv ) ; return $ str ; }
docstring: Converts the output of the given simple data table
  
  @param DataTable|Simple $table
  @param array $allColumns
  @return string
docstring_tokens: Converts the output of the given simple data table