Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
OpenSpout\Writer\ODS\Manager\WorkbookManager Class Reference
Inheritance diagram for OpenSpout\Writer\ODS\Manager\WorkbookManager:
OpenSpout\Writer\Common\Manager\AbstractWorkbookManager OpenSpout\Writer\Common\Manager\WorkbookManagerInterface

Public Member Functions

 __construct (Workbook $workbook, Options $options, WorksheetManager $worksheetManager, StyleManager $styleManager, StyleMerger $styleMerger, FileSystemHelper $fileSystemHelper)
 
 addNewSheetAndMakeItCurrent ()
 Creates a new sheet in the workbook and make it the current sheet.
 
 addRowToCurrentWorksheet (Row $row)
 Adds a row to the current sheet.
 
 close ($finalFilePointer)
 Closes the workbook and all its associated sheets.
 
 getCurrentWorksheet ()
 Returns the current sheet.
 
 getWorksheets ()
 
 setCurrentSheet (Sheet $sheet)
 Sets the given sheet as the current one.
 

Protected Member Functions

 closeRemainingObjects ()
 Closes custom objects that are still opened.
 
 getMaxRowsPerWorksheet ()
 
 writeAllFilesToDiskAndZipThem ($finalFilePointer)
 Writes all the necessary files to disk and zip them together to create the final file.
 

Protected Attributes

FileSystemWithRootFolderHelperInterface FileSystemWithRootFolderHelperInterface $fileSystemHelper
 Helper to perform file system operations.
 
AbstractOptions $options
 
StyleManagerInterface StyleManagerInterface $styleManager
 Manages styles.
 
WorksheetManagerInterface $worksheetManager
 

Member Function Documentation

◆ addNewSheetAndMakeItCurrent()

OpenSpout\Writer\Common\Manager\AbstractWorkbookManager::addNewSheetAndMakeItCurrent ( )
finalinherited

Creates a new sheet in the workbook and make it the current sheet.

The writing will resume where it stopped (i.e. data won't be truncated).

Return values
WorksheetThe created sheet

Implements OpenSpout\Writer\Common\Manager\WorkbookManagerInterface.

◆ addRowToCurrentWorksheet()

OpenSpout\Writer\Common\Manager\AbstractWorkbookManager::addRowToCurrentWorksheet ( Row $row)
finalinherited

Adds a row to the current sheet.

If shouldCreateNewSheetsAutomatically option is set to true, it will handle pagination with the creation of new worksheets if one worksheet has reached its maximum capicity.

Parameters
Row$rowThe row to be added
Exceptions
IOExceptionIf trying to create a new sheet and unable to open the sheet for writing
OpenSpout\Common\Exception\InvalidArgumentException

Implements OpenSpout\Writer\Common\Manager\WorkbookManagerInterface.

◆ close()

OpenSpout\Writer\Common\Manager\AbstractWorkbookManager::close ( $finalFilePointer)
finalinherited

Closes the workbook and all its associated sheets.

All the necessary files are written to disk and zipped together to create the final file. All the temporary files are then deleted.

Parameters
resource$finalFilePointerPointer to the spreadsheet that will be created

Implements OpenSpout\Writer\Common\Manager\WorkbookManagerInterface.

◆ closeRemainingObjects()

OpenSpout\Writer\Common\Manager\AbstractWorkbookManager::closeRemainingObjects ( )
protectedinherited

Closes custom objects that are still opened.

Reimplemented in OpenSpout\Writer\XLSX\Manager\WorkbookManager.

◆ getCurrentWorksheet()

OpenSpout\Writer\Common\Manager\AbstractWorkbookManager::getCurrentWorksheet ( )
finalinherited

Returns the current sheet.

Return values
WorksheetThe current sheet

Implements OpenSpout\Writer\Common\Manager\WorkbookManagerInterface.

◆ getMaxRowsPerWorksheet()

OpenSpout\Writer\ODS\Manager\WorkbookManager::getMaxRowsPerWorksheet ( )
protected
Return values
intMaximum number of rows/columns a sheet can contain

Reimplemented from OpenSpout\Writer\Common\Manager\AbstractWorkbookManager.

◆ getWorksheets()

OpenSpout\Writer\Common\Manager\AbstractWorkbookManager::getWorksheets ( )
finalinherited
Return values
Worksheet[]All the workbook's sheets

Implements OpenSpout\Writer\Common\Manager\WorkbookManagerInterface.

◆ setCurrentSheet()

OpenSpout\Writer\Common\Manager\AbstractWorkbookManager::setCurrentSheet ( Sheet $sheet)
finalinherited

Sets the given sheet as the current one.

New data will be written to this sheet. The writing will resume where it stopped (i.e. data won't be truncated).

Parameters
Sheet$sheetThe "external" sheet to set as current
Exceptions
SheetNotFoundExceptionIf the given sheet does not exist in the workbook

Implements OpenSpout\Writer\Common\Manager\WorkbookManagerInterface.

◆ writeAllFilesToDiskAndZipThem()

OpenSpout\Writer\ODS\Manager\WorkbookManager::writeAllFilesToDiskAndZipThem ( $finalFilePointer)
protected

Writes all the necessary files to disk and zip them together to create the final file.

Parameters
resource$finalFilePointerPointer to the spreadsheet that will be created

Reimplemented from OpenSpout\Writer\Common\Manager\AbstractWorkbookManager.


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