Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
OpenSpout\Writer\WriterInterface Interface Reference
Inheritance diagram for OpenSpout\Writer\WriterInterface:
OpenSpout\Writer\AbstractWriter OpenSpout\Writer\AbstractWriterMultiSheets OpenSpout\Writer\CSV\Writer OpenSpout\Writer\ODS\Writer OpenSpout\Writer\XLSX\Writer

Public Member Functions

 addRow (Row $row)
 Appends a row to the end of the stream.
 
 addRows (array $rows)
 Appends the rows to the end of the stream.
 
 close ()
 Closes the writer.
 
 getWrittenRowCount ()
 
 openToBrowser (string $outputFileName)
 Initializes the writer and opens it to accept data.
 
 openToFile (string $outputFilePath)
 
 setCreator (string $creator)
 Set document creator.
 

Member Function Documentation

◆ addRow()

OpenSpout\Writer\WriterInterface::addRow ( Row $row)

Appends a row to the end of the stream.

Parameters
Row$rowThe row to be appended to the stream
Exceptions
Exception\WriterNotOpenedExceptionIf the writer has not been opened yet
IOExceptionIf unable to write data

Implemented in OpenSpout\Writer\AbstractWriter.

◆ addRows()

OpenSpout\Writer\WriterInterface::addRows ( array $rows)

Appends the rows to the end of the stream.

Parameters
Row[]$rowsThe rows to be appended to the stream
Exceptions
InvalidArgumentExceptionIf the input param is not valid
Exception\WriterNotOpenedExceptionIf the writer has not been opened yet
IOExceptionIf unable to write data

Implemented in OpenSpout\Writer\AbstractWriter.

◆ close()

OpenSpout\Writer\WriterInterface::close ( )

Closes the writer.

This will close the streamer as well, preventing new data to be written to the file.

Implemented in OpenSpout\Writer\AbstractWriter.

◆ getWrittenRowCount()

OpenSpout\Writer\WriterInterface::getWrittenRowCount ( )
Return values
0|positive-int

Implemented in OpenSpout\Writer\AbstractWriter.

◆ openToBrowser()

OpenSpout\Writer\WriterInterface::openToBrowser ( string $outputFileName)

Initializes the writer and opens it to accept data.

By using this method, the data will be outputted directly to the browser.

Parameters
string$outputFileNameName of the output file that will contain the data. If a path is passed in, only the file name will be kept
Exceptions
IOExceptionIf the writer cannot be opened

◆ setCreator()

OpenSpout\Writer\WriterInterface::setCreator ( string $creator)

Set document creator.

Parameters
string$creatordocument creator

Implemented in OpenSpout\Writer\AbstractWriter.


The documentation for this interface was generated from the following file: