ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
PHPExcel_Worksheet_RowIterator Class Reference
+ Inheritance diagram for PHPExcel_Worksheet_RowIterator:
+ Collaboration diagram for PHPExcel_Worksheet_RowIterator:

Public Member Functions

 __construct (PHPExcel_Worksheet $subject=null, $startRow=1, $endRow=null)
 Create a new row iterator. More...
 
 __destruct ()
 Destructor. More...
 
 resetStart ($startRow=1)
 
 resetEnd ($endRow=null)
 
 seek ($row=1)
 
 rewind ()
 Rewind the iterator to the starting row. More...
 
 current ()
 Return the current row in this worksheet. More...
 
 key ()
 Return the current iterator key. More...
 
 next ()
 Set the iterator to its next value. More...
 
 prev ()
 Set the iterator to its previous value. More...
 
 valid ()
 Indicate if more rows exist in the worksheet range of rows that we're iterating. More...
 

Private Attributes

 $_subject
 
 $_position = 1
 
 $_startRow = 1
 
 $_endRow = 1
 

Detailed Description

Definition at line 38 of file RowIterator.php.

Constructor & Destructor Documentation

◆ __construct()

PHPExcel_Worksheet_RowIterator::__construct ( PHPExcel_Worksheet  $subject = null,
  $startRow = 1,
  $endRow = null 
)

Create a new row iterator.

Parameters
PHPExcel_Worksheet$subjectThe worksheet to iterate over
integer$startRowThe row number at which to start iterating
integer$endRowOptionally, the row number at which to stop iterating

Definition at line 77 of file RowIterator.php.

77 {
78 // Set subject
79 $this->_subject = $subject;
80 $this->resetEnd($endRow);
81 $this->resetStart($startRow);
82 }

References resetEnd(), and resetStart().

+ Here is the call graph for this function:

◆ __destruct()

PHPExcel_Worksheet_RowIterator::__destruct ( )

Destructor.

Definition at line 87 of file RowIterator.php.

87 {
88 unset($this->_subject);
89 }

Member Function Documentation

◆ current()

PHPExcel_Worksheet_RowIterator::current ( )

Return the current row in this worksheet.

Returns
PHPExcel_Worksheet_Row

Definition at line 144 of file RowIterator.php.

144 {
145 return new PHPExcel_Worksheet_Row($this->_subject, $this->_position);
146 }

◆ key()

PHPExcel_Worksheet_RowIterator::key ( )

Return the current iterator key.

Returns
int

Definition at line 153 of file RowIterator.php.

References $_position.

◆ next()

PHPExcel_Worksheet_RowIterator::next ( )

Set the iterator to its next value.

Definition at line 160 of file RowIterator.php.

160 {
162 }

References $_position.

◆ prev()

PHPExcel_Worksheet_RowIterator::prev ( )

Set the iterator to its previous value.

Definition at line 167 of file RowIterator.php.

167 {
168 if ($this->_position <= $this->_startRow) {
169 throw new PHPExcel_Exception("Row is already at the beginning of range ({$this->_startRow} - {$this->_endRow})");
170 }
171
173 }

References $_position.

◆ resetEnd()

PHPExcel_Worksheet_RowIterator::resetEnd (   $endRow = null)
(Re)Set the end row

@param integer      $endRow The row number at which to stop iterating
Returns
PHPExcel_Worksheet_RowIterator

Definition at line 110 of file RowIterator.php.

110 {
111 $this->_endRow = ($endRow) ? $endRow : $this->_subject->getHighestRow();
112
113 return $this;
114 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ resetStart()

PHPExcel_Worksheet_RowIterator::resetStart (   $startRow = 1)
(Re)Set the start row and the current row pointer

@param integer      $startRow       The row number at which to start iterating
Returns
PHPExcel_Worksheet_RowIterator

Definition at line 97 of file RowIterator.php.

97 {
98 $this->_startRow = $startRow;
99 $this->seek($startRow);
100
101 return $this;
102 }

References seek().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rewind()

PHPExcel_Worksheet_RowIterator::rewind ( )

Rewind the iterator to the starting row.

Definition at line 135 of file RowIterator.php.

135 {
136 $this->_position = $this->_startRow;
137 }

References $_startRow.

◆ seek()

PHPExcel_Worksheet_RowIterator::seek (   $row = 1)
Set the row pointer to the selected row

@param integer      $row    The row number to set the current pointer at
Returns
PHPExcel_Worksheet_RowIterator
Exceptions
PHPExcel_Exception

Definition at line 123 of file RowIterator.php.

123 {
124 if (($row < $this->_startRow) || ($row > $this->_endRow)) {
125 throw new PHPExcel_Exception("Row $row is out of range ({$this->_startRow} - {$this->_endRow})");
126 }
127 $this->_position = $row;
128
129 return $this;
130 }

References $row.

Referenced by resetStart().

+ Here is the caller graph for this function:

◆ valid()

PHPExcel_Worksheet_RowIterator::valid ( )

Indicate if more rows exist in the worksheet range of rows that we're iterating.

Returns
boolean

Definition at line 180 of file RowIterator.php.

180 {
181 return $this->_position <= $this->_endRow;
182 }

References $_endRow.

Field Documentation

◆ $_endRow

PHPExcel_Worksheet_RowIterator::$_endRow = 1
private

Definition at line 67 of file RowIterator.php.

Referenced by valid().

◆ $_position

PHPExcel_Worksheet_RowIterator::$_position = 1
private

Definition at line 52 of file RowIterator.php.

Referenced by key(), next(), and prev().

◆ $_startRow

PHPExcel_Worksheet_RowIterator::$_startRow = 1
private

Definition at line 59 of file RowIterator.php.

Referenced by rewind().

◆ $_subject

PHPExcel_Worksheet_RowIterator::$_subject
private

Definition at line 45 of file RowIterator.php.


The documentation for this class was generated from the following file: