Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 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.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401]

(no description)

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

Defines 1 class

WorksheetManager:: (8 methods):
  __construct()
  startSheet()
  throwIfSheetFilePointerIsNotAvailable()
  getTableElementStartAsString()
  addRow()
  applyStyleAndGetCellXML()
  getCellXML()
  close()


Class: WorksheetManager  - X-Ref

Class WorksheetManager
ODS worksheet manager, providing the interfaces to work with ODS worksheets.

__construct(StyleManager $styleManager,StyleMerger $styleMerger,ODSEscaper $stringsEscaper,StringHelper $stringHelper)   X-Ref
WorksheetManager constructor.

param: StyleManager $styleManager
param: StyleMerger $styleMerger
param: ODSEscaper $stringsEscaper
param: StringHelper $stringHelper

startSheet(Worksheet $worksheet)   X-Ref
Prepares the worksheet to accept data

param: Worksheet $worksheet The worksheet to start
return: void

throwIfSheetFilePointerIsNotAvailable($sheetFilePointer)   X-Ref
Checks if the sheet has been sucessfully created. Throws an exception if not.

param: bool|resource $sheetFilePointer Pointer to the sheet data file or FALSE if unable to open the file
return: void

getTableElementStartAsString(Worksheet $worksheet)   X-Ref
Returns the table XML root node as string.

param: Worksheet $worksheet
return: string <table> node as string

addRow(Worksheet $worksheet, Row $row)   X-Ref
Adds a row to the given worksheet.

param: Worksheet $worksheet The worksheet to add the row to
param: Row $row The row to be added
return: void

applyStyleAndGetCellXML(Cell $cell, Style $rowStyle, $currentCellIndex, $nextCellIndex)   X-Ref
Applies styles to the given style, merging the cell's style with its row's style
Then builds and returns xml for the cell.

param: Cell $cell
param: Style $rowStyle
param: int $currentCellIndex
param: int $nextCellIndex
return: string

getCellXML(Cell $cell, $styleIndex, $numTimesValueRepeated)   X-Ref
Returns the cell XML content, given its value.

param: Cell $cell The cell to be written
param: int $styleIndex Index of the used style
param: int $numTimesValueRepeated Number of times the value is consecutively repeated
return: string The cell XML content

close(Worksheet $worksheet)   X-Ref
Closes the worksheet

param: Worksheet $worksheet
return: void