class ColumnIterator implements Iterator (View source)

Methods

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

Create a new column iterator.

__destruct()

Destructor.

resetStart(string $startColumn = 'A')

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

resetEnd(string $endColumn = null)

(Re)Set the end column.

seek(string $column = 'A')

Set the column pointer to the selected column.

rewind()

Rewind the iterator to the starting column.

current()

Return the current column in this worksheet.

string
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 columns exist in the worksheet range of columns that we're iterating.

Details

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

Create a new column iterator.

Parameters

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()

Destructor.

ColumnIterator resetStart(string $startColumn = 'A')

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

Parameters

string $startColumn The column address at which to start iterating

Return Value

ColumnIterator

Exceptions

Exception

ColumnIterator resetEnd(string $endColumn = null)

(Re)Set the end column.

Parameters

string $endColumn The column address at which to stop iterating

Return Value

ColumnIterator

ColumnIterator seek(string $column = 'A')

Set the column pointer to the selected column.

Parameters

string $column The column address to set the current pointer at

Return Value

ColumnIterator

Exceptions

Exception

rewind()

Rewind the iterator to the starting column.

Column current()

Return the current column in this worksheet.

Return Value

Column

string key()

Return the current iterator key.

Return Value

string

next()

Set the iterator to its next value.

prev()

Set the iterator to its previous value.

bool valid()

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

Return Value

bool