Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
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
OpenSpout\Writer\Exception\WriterNotOpenedExceptionIf the writer has not been opened yet
OpenSpout\Common\Exception\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
OpenSpout\Common\Exception\InvalidArgumentExceptionIf the input param is not valid
OpenSpout\Writer\Exception\WriterNotOpenedExceptionIf the writer has not been opened yet
OpenSpout\Common\Exception\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
OpenSpout\Common\Exception\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: