ColumnIterator
in package
implements
Iterator
Tags
Table of Contents
Interfaces
- Iterator
Properties
- $currentColumnIndex : int
- Current iterator position.
- $endColumnIndex : int
- End position.
- $startColumnIndex : int
- Start position.
- $worksheet : Worksheet
- Worksheet to iterate.
Methods
- __construct() : mixed
- Create a new column iterator.
- __destruct() : mixed
- Destructor.
- current() : Column
- Return the current column in this worksheet.
- key() : string
- Return the current iterator key.
- next() : void
- Set the iterator to its next value.
- prev() : void
- Set the iterator to its previous value.
- resetEnd() : $this
- (Re)Set the end column.
- resetStart() : $this
- (Re)Set the start column and the current column pointer.
- rewind() : void
- Rewind the iterator to the starting column.
- seek() : $this
- Set the column pointer to the selected column.
- valid() : bool
- Indicate if more columns exist in the worksheet range of columns that we're iterating.
Properties
$currentColumnIndex
Current iterator position.
private
int
$currentColumnIndex
= 1
$endColumnIndex
End position.
private
int
$endColumnIndex
= 1
$startColumnIndex
Start position.
private
int
$startColumnIndex
= 1
$worksheet
Worksheet to iterate.
private
Worksheet
$worksheet
Methods
__construct()
Create a new column iterator.
public
__construct(Worksheet $worksheet[, string $startColumn = 'A' ][, string|null $endColumn = null ]) : mixed
Parameters
- $worksheet : Worksheet
-
The worksheet to iterate over
- $startColumn : string = 'A'
-
The column address at which to start iterating
- $endColumn : string|null = null
-
Optionally, the column address at which to stop iterating
__destruct()
Destructor.
public
__destruct() : mixed
current()
Return the current column in this worksheet.
public
current() : Column
Return values
Columnkey()
Return the current iterator key.
public
key() : string
Return values
stringnext()
Set the iterator to its next value.
public
next() : void
prev()
Set the iterator to its previous value.
public
prev() : void
resetEnd()
(Re)Set the end column.
public
resetEnd([string|null $endColumn = null ]) : $this
Parameters
- $endColumn : string|null = null
-
The column address at which to stop iterating
Return values
$thisresetStart()
(Re)Set the start column and the current column pointer.
public
resetStart([string $startColumn = 'A' ]) : $this
Parameters
- $startColumn : string = 'A'
-
The column address at which to start iterating
Return values
$thisrewind()
Rewind the iterator to the starting column.
public
rewind() : void
seek()
Set the column pointer to the selected column.
public
seek([string $column = 'A' ]) : $this
Parameters
- $column : string = 'A'
-
The column address to set the current pointer at
Return values
$thisvalid()
Indicate if more columns exist in the worksheet range of columns that we're iterating.
public
valid() : bool