71 $this->_subject = $subject;
72 $this->_rowIndex = $rowIndex;
81 unset($this->_subject);
93 $this->_startColumn = $startColumnIndex;
108 $endColumn = ($endColumn) ? $endColumn : $this->_subject->getHighestColumn();
124 if (($column < $this->_startColumn) || (
$column > $this->_endColumn)) {
125 throw new PHPExcel_Exception(
"Column $column is out of range ({$this->_startColumn} - {$this->_endColumn})");
126 } elseif ($this->_onlyExistingCells && !($this->_subject->cellExistsByColumnAndRow(
$column, $this->_rowIndex))) {
127 throw new PHPExcel_Exception(
'In "IterateOnlyExistingCells" mode and Cell does not exist');
147 return $this->_subject->getCellByColumnAndRow($this->_position, $this->_rowIndex);
165 }
while (($this->_onlyExistingCells) &&
166 (!$this->_subject->cellExistsByColumnAndRow($this->_position, $this->_rowIndex)) &&
167 ($this->_position <= $this->_endColumn));
176 if ($this->_position <= $this->_startColumn) {
178 "Column is already at the beginning of range (" .
186 }
while (($this->_onlyExistingCells) &&
187 (!$this->_subject->cellExistsByColumnAndRow($this->_position, $this->_rowIndex)) &&
188 ($this->_position >= $this->_startColumn));
206 if ($this->_onlyExistingCells) {
207 while ((!$this->_subject->cellExistsByColumnAndRow($this->_startColumn, $this->_rowIndex)) &&
208 ($this->_startColumn <= $this->_endColumn)) {
211 if ($this->_startColumn > $this->_endColumn) {
214 while ((!$this->_subject->cellExistsByColumnAndRow($this->_endColumn, $this->_rowIndex)) &&
215 ($this->_endColumn >= $this->_startColumn)) {
218 if ($this->_endColumn < $this->_startColumn) {
seek($column='A')
Set the column pointer to the selected column.
key()
Return the current iterator key.
adjustForExistingOnlyRange()
Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary.
prev()
Set the iterator to its previous value.
current()
Return the current cell in this worksheet row.
valid()
Indicate if more columns exist in the worksheet range of columns that we're iterating.
__construct(PHPExcel_Worksheet $subject=null, $rowIndex=1, $startColumn='A', $endColumn=null)
Create a new column iterator.
static columnIndexFromString($pString='A')
Column index from string.
resetEnd($endColumn=null)
(Re)Set the end column
static stringFromColumnIndex($pColumnIndex=0)
String from columnindex.
next()
Set the iterator to its next value.
rewind()
Rewind the iterator to the starting column.
resetStart($startColumn='A')
(Re)Set the start column and the current column pointer