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