class RowIterator implements Iterator (View source)

Methods

__construct(Worksheet $subject, int $startRow = 1, int $endRow = null)

Create a new row iterator.

__destruct()

Destructor.

resetStart(int $startRow = 1)

(Re)Set the start row and the current row pointer.

resetEnd(int $endRow = null)

(Re)Set the end row.

seek(int $row = 1)

Set the row pointer to the selected row.

rewind()

Rewind the iterator to the starting row.

Row
current()

Return the current row in this worksheet.

int
key()

Return the current iterator key.

next()

Set the iterator to its next value.

prev()

Set the iterator to its previous value.

bool
valid()

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

Details

__construct(Worksheet $subject, int $startRow = 1, int $endRow = null)

Create a new row iterator.

Parameters

Worksheet $subject The worksheet to iterate over
int $startRow The row number at which to start iterating
int $endRow Optionally, the row number at which to stop iterating

__destruct()

Destructor.

RowIterator resetStart(int $startRow = 1)

(Re)Set the start row and the current row pointer.

Parameters

int $startRow The row number at which to start iterating

Return Value

RowIterator

Exceptions

Exception

RowIterator resetEnd(int $endRow = null)

(Re)Set the end row.

Parameters

int $endRow The row number at which to stop iterating

Return Value

RowIterator

RowIterator seek(int $row = 1)

Set the row pointer to the selected row.

Parameters

int $row The row number to set the current pointer at

Return Value

RowIterator

Exceptions

Exception

rewind()

Rewind the iterator to the starting row.

Row current()

Return the current row in this worksheet.

Return Value

Row

int key()

Return the current iterator key.

Return Value

int

next()

Set the iterator to its next value.

prev()

Set the iterator to its previous value.

bool valid()

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

Return Value

bool