Search moodle.org's
Developer Documentation

See Release Notes

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

Differences Between: [Versions 402 and 403]

(no description)

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

Defines 1 class

WriterInterface:: (7 methods):
  openToFile()
  openToBrowser()
  addRow()
  addRows()
  setCreator()
  getWrittenRowCount()
  close()


Interface: WriterInterface  - X-Ref

openToFile(string $outputFilePath)   X-Ref
Initializes the writer and opens it to accept data.
By using this method, the data will be written to a file.

param: string $outputFilePath Path of the output file that will contain the data

openToBrowser(string $outputFileName)   X-Ref
Initializes the writer and opens it to accept data.
By using this method, the data will be outputted directly to the browser.

param: string $outputFileName Name of the output file that will contain the data. If a path is passed in, only the file name will be kept

addRow(Row $row)   X-Ref
Appends a row to the end of the stream.

param: Row $row The row to be appended to the stream

addRows(array $rows)   X-Ref
Appends the rows to the end of the stream.

param: Row[] $rows The rows to be appended to the stream

setCreator(string $creator)   X-Ref
Set document creator.

param: string $creator document creator

getWrittenRowCount()   X-Ref

return: 0|positive-int

close()   X-Ref
Closes the writer. This will close the streamer as well, preventing new data
to be written to the file.