Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 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.

(no description)

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

Defines 1 class

WriterInterface:: (6 methods):
  openToFile()
  openToBrowser()
  setDefaultRowStyle()
  addRow()
  addRows()
  close()


Interface: WriterInterface  - X-Ref

Interface WriterInterface

openToFile($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
return: WriterInterface

openToBrowser($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
return: WriterInterface

setDefaultRowStyle(Style $defaultStyle)   X-Ref
Sets the default styles for all rows added with "addRow".
Overriding the default style instead of using "addRowWithStyle" improves performance by 20%.

param: Style $defaultStyle
return: WriterInterface

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
return: WriterInterface

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
return: WriterInterface

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

return: void