Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

(no description)

File Size: 352 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: resource|string $pFilename

getDelimiter()   X-Ref
Get delimiter.

return: string

setDelimiter($pValue)   X-Ref
Set delimiter.

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

getEnclosure()   X-Ref
Get enclosure.

return: string

setEnclosure($pValue = '"')   X-Ref
Set enclosure.

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

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: $this

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: $this

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: $this

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: $this

getSheetIndex()   X-Ref
Get sheet index.

return: int

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

param: int $pValue Sheet index
return: $this

setEnclosureRequired(bool $value)   X-Ref
No description

getEnclosureRequired()   X-Ref
No description

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