62 if (
$startRow > $this->subject->getHighestRow()) {
63 throw new PhpSpreadsheetException(
64 "Start row ({$startRow}) is beyond highest row ({$this->subject->getHighestRow()})"
69 if ($this->endRow < $this->startRow) {
86 $this->endRow =
$endRow ?: $this->subject->getHighestRow();
100 if (($row < $this->startRow) || (
$row > $this->endRow)) {
101 throw new PhpSpreadsheetException(
"Row $row is out of range ({$this->startRow} - {$this->endRow})");
103 $this->position =
$row;
123 return new Row($this->subject, $this->position);
129 public function key(): int
155 return $this->position <= $this->endRow && $this->position >=
$this->startRow;
An exception for terminatinating execution or to throw for unit testing.
rewind()
Rewind the iterator to the starting row.
next()
Set the iterator to its next value.
key()
Return the current iterator key.
seek(int $row=1)
Set the row pointer to the selected row.
valid()
Indicate if more rows exist in the worksheet range of rows that we're iterating.
__construct(Worksheet $subject, $startRow=1, $endRow=null)
Create a new row iterator.
prev()
Set the iterator to its previous value.
resetStart(int $startRow=1)
(Re)Set the start row and the current row pointer.
current()
Return the current row in this worksheet.
resetEnd($endRow=null)
(Re)Set the end row.