Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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

(no description)

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

Defines 1 class


Class: RowIterator  - X-Ref

Class RowIterator

__construct($filePath,$sheetDataXMLFilePath,$shouldPreserveEmptyRows,$xmlReader,XMLProcessor $xmlProcessor,CellValueFormatter $cellValueFormatter,RowManager $rowManager,InternalEntityFactory $entityFactory)   X-Ref

param: string $filePath Path of the XLSX file being read
param: string $sheetDataXMLFilePath Path of the sheet data XML file as in [Content_Types].xml
param: bool $shouldPreserveEmptyRows Whether empty rows should be preserved
param: XMLReader $xmlReader XML Reader
param: XMLProcessor $xmlProcessor Helper to process XML files
param: CellValueFormatter $cellValueFormatter Helper to format cell values
param: RowManager $rowManager Manages rows
param: InternalEntityFactory $entityFactory Factory to create entities

normalizeSheetDataXMLFilePath($sheetDataXMLFilePath)   X-Ref

return: string Path of the XML file containing the sheet data,
param: string $sheetDataXMLFilePath Path of the sheet data XML file as in [Content_Types].xml

rewind()   X-Ref
Rewind the Iterator to the first element.
Initializes the XMLReader object that reads the associated sheet data.
The XMLReader is configured to be safe from billion laughs attack.

return: void

valid()   X-Ref
Checks if current position is valid

return: bool

next()   X-Ref
Move forward to next element. Reads data describing the next unprocessed row.

return: void

doesNeedDataForNextRowToBeProcessed()   X-Ref
Returns whether we need data for the next row to be processed.
We don't need to read data if:
we have already read at least one row
AND
we need to preserve empty rows
AND
the last row that was read is not the row that need to be processed
(i.e. if we need to return empty rows)

return: bool Whether we need data for the next row to be processed.

readDataForNextRow()   X-Ref

return: void

processDimensionStartingNode($xmlReader)   X-Ref

return: int A return code that indicates what action should the processor take next
param: \Box\Spout\Reader\Wrapper\XMLReader $xmlReader XMLReader object, positioned on a "<dimension>" starting node

processRowStartingNode($xmlReader)   X-Ref

return: int A return code that indicates what action should the processor take next
param: \Box\Spout\Reader\Wrapper\XMLReader $xmlReader XMLReader object, positioned on a "<row>" starting node

processCellStartingNode($xmlReader)   X-Ref

return: int A return code that indicates what action should the processor take next
param: \Box\Spout\Reader\Wrapper\XMLReader $xmlReader XMLReader object, positioned on a "<cell>" starting node

processRowEndingNode()   X-Ref

return: int A return code that indicates what action should the processor take next

processWorksheetEndingNode()   X-Ref

return: int A return code that indicates what action should the processor take next

getRowIndex($xmlReader)   X-Ref

return: int Row index
param: \Box\Spout\Reader\Wrapper\XMLReader $xmlReader XMLReader object, positioned on a "<row>" node

getColumnIndex($xmlReader)   X-Ref

return: int Column index
param: \Box\Spout\Reader\Wrapper\XMLReader $xmlReader XMLReader object, positioned on a "<c>" node

getCell($node)   X-Ref
Returns the cell with (unescaped) correctly marshalled, cell value associated to the given XML node.

return: Cell The cell set with the associated with the cell
param: \DOMNode $node

current()   X-Ref
Return the current element, either an empty row or from the buffer.

return: Row|null

key()   X-Ref
Return the key of the current element. Here, the row index.

return: int

end()   X-Ref
Cleans up what was created to iterate over the object.

return: void