Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

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

(no description)

File Size: 326 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.


save($filename, int $flags = 0)   X-Ref
Save PhpSpreadsheet to file.

param: resource|string $filename

getDelimiter()   X-Ref
No description

setDelimiter(string $delimiter)   X-Ref
No description

getEnclosure()   X-Ref
No description

setEnclosure(string $enclosure = '"')   X-Ref
No description

getLineEnding()   X-Ref
No description

setLineEnding(string $lineEnding)   X-Ref
No description

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


setUseBOM(bool $useBOM)   X-Ref
Set whether BOM should be used, typically when non-ASCII characters are used.


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


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


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


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

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

getSheetIndex()   X-Ref
No description

setSheetIndex(int $sheetIndex)   X-Ref
No description

getOutputEncoding()   X-Ref
No description

setOutputEncoding(string $outputEnconding)   X-Ref
No description

setEnclosureRequired(bool $value)   X-Ref
No description

getEnclosureRequired()   X-Ref
No description

elementToString($element)   X-Ref
Convert boolean to TRUE/FALSE; otherwise return element cast to string.

param: mixed $element

writeLine($fileHandle, array $values)   X-Ref
Write line to CSV file.

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