Documentation

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

$position

Current iterator position.

private int $position = 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
mixed

resetStart()

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

resetEnd()

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

seek()

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

rewind()

Rewind the iterator to the starting row.

public rewind( ) : void

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

valid()

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

public valid( ) : bool
Return values
bool

Search results