Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

(no description)

File Size: 342 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: Csv  - X-Ref

__construct(Spreadsheet $spreadsheet)   X-Ref
Create a new CSV.

param: Spreadsheet $spreadsheet Spreadsheet object

save($pFilename)   X-Ref
Save PhpSpreadsheet to file.

param: string $pFilename

getDelimiter()   X-Ref
Get delimiter.

return: string

setDelimiter($pValue)   X-Ref
Set delimiter.

param: string $pValue Delimiter, defaults to ','
return: CSV

getEnclosure()   X-Ref
Get enclosure.

return: string

setEnclosure($pValue)   X-Ref
Set enclosure.

param: string $pValue Enclosure, defaults to "
return: CSV

getLineEnding()   X-Ref
Get line ending.

return: string

setLineEnding($pValue)   X-Ref
Set line ending.

param: string $pValue Line ending, defaults to OS line ending (PHP_EOL)
return: CSV

getUseBOM()   X-Ref
Get whether BOM should be used.

return: bool

setUseBOM($pValue)   X-Ref
Set whether BOM should be used.

param: bool $pValue Use UTF-8 byte-order mark? Defaults to false
return: CSV

getIncludeSeparatorLine()   X-Ref
Get whether a separator line should be included.

return: bool

setIncludeSeparatorLine($pValue)   X-Ref
Set whether a separator line should be included as the first line of the file.

param: bool $pValue Use separator line? Defaults to false
return: CSV

getExcelCompatibility()   X-Ref
Get whether the file should be saved with full Excel Compatibility.

return: bool

setExcelCompatibility($pValue)   X-Ref
Set whether the file should be saved with full Excel Compatibility.

param: bool $pValue Set the file to be written as a fully Excel compatible csv file
return: CSV

getSheetIndex()   X-Ref
Get sheet index.

return: int

setSheetIndex($pValue)   X-Ref
Set sheet index.

param: int $pValue Sheet index
return: CSV

writeLine($pFileHandle, array $pValues)   X-Ref
Write line to CSV file.

param: resource $pFileHandle PHP filehandle
param: array $pValues Array containing values in a row