71 $this->_subject = $subject;
81 unset($this->_subject);
92 $this->_startRow = $startRow;
94 $this->
seek($startRow);
107 $this->_endRow = ($endRow) ? $endRow : $this->_subject->getHighestRow();
121 if (($row < $this->_startRow) || (
$row > $this->_endRow)) {
122 throw new PHPExcel_Exception(
"Row $row is out of range ({$this->_startRow} - {$this->_endRow})");
123 } elseif ($this->_onlyExistingCells && !($this->_subject->cellExistsByColumnAndRow($this->_columnIndex,
$row))) {
124 throw new PHPExcel_Exception(
'In "IterateOnlyExistingCells" mode and Cell does not exist');
126 $this->_position =
$row;
144 return $this->_subject->getCellByColumnAndRow($this->_columnIndex, $this->_position);
162 }
while (($this->_onlyExistingCells) &&
163 (!$this->_subject->cellExistsByColumnAndRow($this->_columnIndex, $this->_position)) &&
164 ($this->_position <= $this->_endRow));
171 if ($this->_position <= $this->_startRow) {
172 throw new PHPExcel_Exception(
"Row is already at the beginning of range ({$this->_startRow} - {$this->_endRow})");
177 }
while (($this->_onlyExistingCells) &&
178 (!$this->_subject->cellExistsByColumnAndRow($this->_columnIndex, $this->_position)) &&
179 ($this->_position >= $this->_startRow));
197 if ($this->_onlyExistingCells) {
198 while ((!$this->_subject->cellExistsByColumnAndRow($this->_columnIndex, $this->_startRow)) &&
199 ($this->_startRow <= $this->_endRow)) {
202 if ($this->_startRow > $this->_endRow) {
205 while ((!$this->_subject->cellExistsByColumnAndRow($this->_columnIndex, $this->_endRow)) &&
206 ($this->_endRow >= $this->_startRow)) {
209 if ($this->_endRow < $this->_startRow) {
next()
Set the iterator to its next value.
key()
Return the current iterator key.
seek($row=1)
Set the row pointer to the selected row.
__construct(PHPExcel_Worksheet $subject=null, $columnIndex, $startRow=1, $endRow=null)
Create a new row iterator.
prev()
Set the iterator to its previous value.
valid()
Indicate if more rows exist in the worksheet range of rows that we're iterating.
resetStart($startRow=1)
(Re)Set the start row and the current row pointer
adjustForExistingOnlyRange()
Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary.
rewind()
Rewind the iterator to the starting row.
static columnIndexFromString($pString='A')
Column index from string.
current()
Return the current cell in this worksheet column.
resetEnd($endRow=null)
(Re)Set the end row