Documentation

RowIterator
in package
implements Iterator

Tags
implements

NativeIterator<int, Row>

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

$position

Current iterator position.

private int $position = 1

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

current()

Return the current row in this worksheet.

public current() : Row
Return values
Row

key()

Return the current iterator key.

public key() : int
Return values
int

next()

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
$this

resetStart()

(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
$this

rewind()

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
$this

valid()

Indicate if more rows exist in the worksheet range of rows that we're iterating.

public valid() : bool
Return values
bool

        
On this page

Search results