Update get cell logic in Cell Iterators
This commit is contained in:
parent
4a071ce578
commit
7201ddd088
|
|
@ -120,7 +120,11 @@ class ColumnCellIterator extends CellIterator
|
|||
*/
|
||||
public function current(): ?Cell
|
||||
{
|
||||
return $this->worksheet->getCellByColumnAndRow($this->columnIndex, $this->currentRow);
|
||||
$cellAddress = Coordinate::stringFromColumnIndex($this->columnIndex) . $this->currentRow;
|
||||
|
||||
return $this->worksheet->getCellCollection()->has($cellAddress)
|
||||
? $this->worksheet->getCellCollection()->get($cellAddress)
|
||||
: $this->worksheet->createNewCell($cellAddress);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -123,7 +123,11 @@ class RowCellIterator extends CellIterator
|
|||
*/
|
||||
public function current(): ?Cell
|
||||
{
|
||||
return $this->worksheet->getCellByColumnAndRow($this->currentColumnIndex, $this->rowIndex);
|
||||
$cellAddress = Coordinate::stringFromColumnIndex($this->currentColumnIndex) . $this->rowIndex;
|
||||
|
||||
return $this->worksheet->getCellCollection()->has($cellAddress)
|
||||
? $this->worksheet->getCellCollection()->get($cellAddress)
|
||||
: $this->worksheet->createNewCell($cellAddress);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue