\PhpOffice\PhpSpreadsheet\WorksheetColumnIterator

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
$worksheet
$currentColumnIndex
$startColumnIndex
$endColumnIndex
N/A

Properties

$worksheet

$worksheet : \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

Worksheet to iterate.

Type

\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet

$currentColumnIndex

$currentColumnIndex : integer

Current iterator position.

Type

integer

$startColumnIndex

$startColumnIndex : integer

Start position.

Type

integer

$endColumnIndex

$endColumnIndex : integer

End position.

Type

integer

Methods

__construct()

__construct(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet  $worksheet, string  $startColumn = 'A', string  $endColumn = null) 

Create a new column iterator.

Parameters

\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $worksheet

The worksheet to iterate over

string $startColumn

The column address at which to start iterating

string $endColumn

Optionally, the column address at which to stop iterating

__destruct()

__destruct() 

Destructor.

resetStart()

resetStart(string  $startColumn = 'A') : $this

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

Parameters

string $startColumn

The column address at which to start iterating

Returns

$this

resetEnd()

resetEnd(string  $endColumn = null) : $this

(Re)Set the end column.

Parameters

string $endColumn

The column address at which to stop iterating

Returns

$this

seek()

seek(string  $column = 'A') : $this

Set the column pointer to the selected column.

Parameters

string $column

The column address to set the current pointer at

Returns

$this

rewind()

rewind() 

Rewind the iterator to the starting column.

current()

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

Return the current column in this worksheet.

Returns

\PhpOffice\PhpSpreadsheet\Worksheet\Column

key()

key() : string

Return the current iterator key.

Returns

string

next()

next() 

Set the iterator to its next value.

prev()

prev() 

Set the iterator to its previous value.

valid()

valid() : boolean

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

Returns

boolean