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