81 $endColumn = $endColumn ?: $this->worksheet->getHighestColumn();
95 public function seek(
string $column =
'A')
99 if ($this->onlyExistingCells && !($this->worksheet->cellExistsByColumnAndRow($column, $this->rowIndex))) {
102 if (($column < $this->startColumnIndex) || ($column > $this->endColumnIndex)) {
103 throw new PhpSpreadsheetException(
"Column $columnx is out of range ({$this->startColumnIndex} - {$this->endColumnIndex})");
105 $this->currentColumnIndex = $column;
123 return $this->worksheet->getCellByColumnAndRow($this->currentColumnIndex, $this->rowIndex);
129 public function key(): string
141 }
while (($this->onlyExistingCells) && (!$this->worksheet->cellExistsByColumnAndRow($this->currentColumnIndex, $this->rowIndex)) && ($this->currentColumnIndex <= $this->endColumnIndex));
151 }
while (($this->onlyExistingCells) && (!$this->worksheet->cellExistsByColumnAndRow($this->currentColumnIndex, $this->rowIndex)) && ($this->currentColumnIndex >= $this->startColumnIndex));
161 return $this->currentColumnIndex <= $this->endColumnIndex && $this->currentColumnIndex >=
$this->startColumnIndex;
177 if ($this->onlyExistingCells) {
178 while ((!$this->worksheet->cellExistsByColumnAndRow($this->startColumnIndex, $this->rowIndex)) && ($this->startColumnIndex <= $this->endColumnIndex)) {
181 while ((!$this->worksheet->cellExistsByColumnAndRow($this->endColumnIndex, $this->rowIndex)) && ($this->endColumnIndex >= $this->startColumnIndex)) {
__construct(?Worksheet $worksheet=null, $rowIndex=1, $startColumn='A', $endColumn=null)
Create a new column iterator.
prev()
Set the iterator to its previous value.
seek(string $column='A')
Set the column pointer to the selected column.
getCurrentColumnIndex()
Return the current iterator position.
current()
Return the current cell in this worksheet row.
resetStart(string $startColumn='A')
(Re)Set the start column and the current column pointer.
next()
Set the iterator to its next value.
rewind()
Rewind the iterator to the starting column.
valid()
Indicate if more columns exist in the worksheet range of columns that we're iterating.
resetEnd($endColumn=null)
(Re)Set the end column.
adjustForExistingOnlyRange()
Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary.
key()
Return the current iterator key.
static columnIndexFromString($pString)
Column index from string.
static stringFromColumnIndex($columnIndex)
String from column index.