RowIterator
in package
implements
Iterator
Tags
Table of Contents
Interfaces
- Iterator
Properties
- $endRow : int
- End position.
- $position : int
- Current iterator position.
- $startRow : int
- Start position.
- $subject : Worksheet
- Worksheet to iterate.
Methods
- __construct() : mixed
- Create a new row iterator.
- __destruct() : mixed
- current() : Row
- Return the current row in this worksheet.
- key() : int
- Return the current iterator key.
- next() : void
- Set the iterator to its next value.
- prev() : void
- Set the iterator to its previous value.
- resetEnd() : $this
- (Re)Set the end row.
- resetStart() : $this
- (Re)Set the start row and the current row pointer.
- rewind() : void
- Rewind the iterator to the starting row.
- seek() : $this
- Set the row pointer to the selected row.
- valid() : bool
- Indicate if more rows exist in the worksheet range of rows that we're iterating.
Properties
$endRow
End position.
private
int
$endRow
= 1
$position
Current iterator position.
private
int
$position
= 1
$startRow
Start position.
private
int
$startRow
= 1
$subject
Worksheet to iterate.
private
Worksheet
$subject
Methods
__construct()
Create a new row iterator.
public
__construct(Worksheet $subject[, int $startRow = 1 ][, int|null $endRow = null ]) : mixed
Parameters
- $subject : Worksheet
-
The worksheet to iterate over
- $startRow : int = 1
-
The row number at which to start iterating
- $endRow : int|null = null
-
Optionally, the row number at which to stop iterating
__destruct()
public
__destruct() : mixed
current()
Return the current row in this worksheet.
public
current() : Row
Return values
Rowkey()
Return the current iterator key.
public
key() : int
Return values
intnext()
Set the iterator to its next value.
public
next() : void
prev()
Set the iterator to its previous value.
public
prev() : void
resetEnd()
(Re)Set the end row.
public
resetEnd([int|null $endRow = null ]) : $this
Parameters
- $endRow : int|null = null
-
The row number at which to stop iterating
Return values
$thisresetStart()
(Re)Set the start row and the current row pointer.
public
resetStart([int $startRow = 1 ]) : $this
Parameters
- $startRow : int = 1
-
The row number at which to start iterating
Return values
$thisrewind()
Rewind the iterator to the starting row.
public
rewind() : void
seek()
Set the row pointer to the selected row.
public
seek([int $row = 1 ]) : $this
Parameters
- $row : int = 1
-
The row number to set the current pointer at
Return values
$thisvalid()
Indicate if more rows exist in the worksheet range of rows that we're iterating.
public
valid() : bool