\PhpOffice\PhpSpreadsheet\WorksheetRowIterator

Summary

Methods
Properties
Constants
__construct()
__destruct()
resetStart()
resetEnd()
seek()
rewind()
current()
key()
next()
prev()
valid()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$subject
$position
$startRow
$endRow
N/A

Properties

$subject

$subject : \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

Worksheet to iterate.

Type

\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

$position

$position : integer

Current iterator position.

Type

integer

$startRow

$startRow : integer

Start position.

Type

integer

$endRow

$endRow : integer

End position.

Type

integer

Methods

__construct()

__construct(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet  $subject, integer  $startRow = 1, integer  $endRow = null) 

Create a new row iterator.

Parameters

\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $subject

The worksheet to iterate over

integer $startRow

The row number at which to start iterating

integer $endRow

Optionally, the row number at which to stop iterating

__destruct()

__destruct() 

Destructor.

resetStart()

resetStart(integer  $startRow = 1) : $this

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

Parameters

integer $startRow

The row number at which to start iterating

Returns

$this

resetEnd()

resetEnd(integer  $endRow = null) : $this

(Re)Set the end row.

Parameters

integer $endRow

The row number at which to stop iterating

Returns

$this

seek()

seek(integer  $row = 1) : $this

Set the row pointer to the selected row.

Parameters

integer $row

The row number to set the current pointer at

Returns

$this

rewind()

rewind() 

Rewind the iterator to the starting row.

current()

current() : \PhpOffice\PhpSpreadsheet\Worksheet\Row

Return the current row in this worksheet.

Returns

\PhpOffice\PhpSpreadsheet\Worksheet\Row

key()

key() : integer

Return the current iterator key.

Returns

integer

next()

next() 

Set the iterator to its next value.

prev()

prev() 

Set the iterator to its previous value.

valid()

valid() : boolean

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

Returns

boolean