61 $this->worksheet =
null;
76 "Start column ({$startColumn}) is beyond highest column ({$this->worksheet->getHighestColumn()})"
81 if ($this->endColumnIndex < $this->startColumnIndex) {
84 $this->
seek($startColumn);
98 $endColumn = $endColumn ?: $this->worksheet->getHighestColumn();
111 public function seek(
string $column =
'A')
114 if (($column < $this->startColumnIndex) || ($column > $this->endColumnIndex)) {
115 throw new PhpSpreadsheetException(
116 "Column $column is out of range ({$this->startColumnIndex} - {$this->endColumnIndex})"
119 $this->currentColumnIndex = $column;
145 public function key(): string
171 return $this->currentColumnIndex <= $this->endColumnIndex && $this->currentColumnIndex >=
$this->startColumnIndex;
An exception for terminatinating execution or to throw for unit testing.
Helper class to manipulate cell coordinates.
static columnIndexFromString($pString)
Column index from string.
static stringFromColumnIndex($columnIndex)
String from column index.
seek(string $column='A')
Set the column pointer to the selected column.
prev()
Set the iterator to its previous value.
next()
Set the iterator to its next value.
valid()
Indicate if more columns exist in the worksheet range of columns that we're iterating.
current()
Return the current column in this worksheet.
resetEnd($endColumn=null)
(Re)Set the end column.
__construct(Worksheet $worksheet, $startColumn='A', $endColumn=null)
Create a new column iterator.
resetStart(string $startColumn='A')
(Re)Set the start column and the current column pointer.
key()
Return the current iterator key.
rewind()
Rewind the iterator to the starting column.