class RowCellIterator extends CellIterator (View source)

Properties

protected Worksheet $worksheet Worksheet to iterate. from CellIterator
protected bool $onlyExistingCells Iterate only existing cells. from CellIterator

Methods

__destruct()

Destructor.

bool
getIterateOnlyExistingCells()

Get loop only existing cells.

adjustForExistingOnlyRange()

Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary.

setIterateOnlyExistingCells(bool $value)

Set the iterator to loop only existing cells.

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

Create a new column iterator.

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 cell in this worksheet row.

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.

int
getCurrentColumnIndex()

Return the current iterator position.

Details

__destruct()

Destructor.

bool getIterateOnlyExistingCells()

Get loop only existing cells.

Return Value

bool

protected adjustForExistingOnlyRange()

Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary.

Exceptions

Exception

setIterateOnlyExistingCells(bool $value)

Set the iterator to loop only existing cells.

Parameters

bool $value

Exceptions

Exception

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

Create a new column iterator.

Parameters

Worksheet $worksheet The worksheet to iterate over
int $rowIndex The row that we want to iterate
string $startColumn The column address at which to start iterating
string $endColumn Optionally, the column address at which to stop iterating

RowCellIterator 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

RowCellIterator

Exceptions

Exception

RowCellIterator resetEnd(string $endColumn = null)

(Re)Set the end column.

Parameters

string $endColumn The column address at which to stop iterating

Return Value

RowCellIterator

Exceptions

Exception

RowCellIterator 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

RowCellIterator

Exceptions

Exception

rewind()

Rewind the iterator to the starting column.

Cell current()

Return the current cell in this worksheet row.

Return Value

Cell

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.

Exceptions

Exception

bool valid()

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

Return Value

bool

int getCurrentColumnIndex()

Return the current iterator position.

Return Value

int