Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

(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

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

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

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

processRowStartingNode($xmlReader)   X-Ref

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

processCellStartingNode($xmlReader)   X-Ref

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

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

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

getColumnIndex($xmlReader)   X-Ref

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

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

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

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