Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 402 and 403]

(no description)

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

Defines 1 class


Class: RowIterator  - X-Ref

__construct(Options $options,CellValueFormatter $cellValueFormatter,XMLProcessor $xmlProcessor)   X-Ref
No description

rewind()   X-Ref
Rewind the Iterator to the first element.
NOTE: It can only be done once, as it is not possible to read an XML file backwards.


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


next()   X-Ref
Move forward to next element. Empty rows will be skipped.


current()   X-Ref
Return the current element, from the buffer.


key()   X-Ref
Return the key of the current element.


doesNeedDataForNextRowToBeProcessed()   X-Ref
Returns whether we need data for the next row to be processed.
We DO need to read data if:
- we have not read any rows yet
OR
- the next row to be processed immediately follows the last read row.

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

readDataForNextRow()   X-Ref


processRowStartingNode(XMLReader $xmlReader)   X-Ref

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

processCellStartingNode(XMLReader $xmlReader)   X-Ref

param: XMLReader $xmlReader XMLReader object, positioned on a "<table:table-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

processTableEndingNode()   X-Ref

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

getNumRowsRepeatedForCurrentNode(XMLReader $xmlReader)   X-Ref

param: XMLReader $xmlReader XMLReader object, positioned on a "<table:table-row>" starting node
return: int The value of "table:number-rows-repeated" attribute of the current node, or 1 if attribute missing

getNumColumnsRepeatedForCurrentNode(XMLReader $xmlReader)   X-Ref

param: XMLReader $xmlReader XMLReader object, positioned on a "<table:table-cell>" starting node
return: int The value of "table:number-columns-repeated" attribute of the current node, or 1 if attribute missing

getCell(DOMElement $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

isEmptyRow(Row $currentRow, ?Cell $lastReadCell)   X-Ref
After finishing processing each cell, a row is considered empty if it contains
no cells or if the last read cell is empty.
After finishing processing each cell, the last read cell is not part of the
row data yet (as we still need to apply the "num-columns-repeated" attribute).

param: null|Cell $lastReadCell The last read cell
return: bool Whether the row is empty