1 | <?php |
||
18 | abstract class AbstractXlsxFileIterator extends AbstractFileIterator implements ContainerAwareInterface |
||
19 | { |
||
20 | /** @var ContainerInterface */ |
||
21 | protected $container; |
||
22 | |||
23 | /** @var Iterator */ |
||
24 | protected $worksheetIterator; |
||
25 | |||
26 | /** @var Iterator */ |
||
27 | protected $valuesIterator; |
||
28 | |||
29 | /** @var SpreadsheetInterface */ |
||
30 | private $xls; |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | public function current() |
||
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | public function key() |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | public function next() |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | public function rewind() |
||
83 | |||
84 | /** |
||
85 | * Returns the associated Excel object |
||
86 | * |
||
87 | * @return SpreadsheetInterface |
||
88 | */ |
||
89 | public function getExcelObject() |
||
97 | |||
98 | /** |
||
99 | * @inheritdoc |
||
100 | */ |
||
101 | public function valid() |
||
105 | |||
106 | /** |
||
107 | * Initializes the current worksheet |
||
108 | */ |
||
109 | protected function initializeValuesIterator() |
||
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | public function setContainer(ContainerInterface $container = null) |
||
129 | |||
130 | /** |
||
131 | * Returns true if the worksheet should be read |
||
132 | * |
||
133 | * @param string $title |
||
134 | * |
||
135 | * @return boolean |
||
136 | */ |
||
137 | protected function isReadableWorksheet($title) |
||
141 | |||
142 | /** |
||
143 | * Returns true if the worksheet should be indluded |
||
144 | * |
||
145 | * @param string $title The title of the worksheet |
||
146 | * |
||
147 | * @return boolean |
||
148 | */ |
||
149 | protected function isIncludedWorksheet($title) |
||
163 | |||
164 | /** |
||
165 | * Returns true if the worksheet should be excluded |
||
166 | * |
||
167 | * @param string $title The title of the worksheet |
||
168 | * |
||
169 | * @return boolean |
||
170 | */ |
||
171 | protected function isExcludedWorksheet($title) |
||
181 | |||
182 | /** |
||
183 | * {@inheritdoc} |
||
184 | */ |
||
185 | protected function setDefaultOptions(OptionsResolver $resolver) |
||
195 | |||
196 | /** |
||
197 | * Returns the Array Helper service |
||
198 | * |
||
199 | * @return ArrayHelper |
||
200 | */ |
||
201 | protected function getArrayHelper() |
||
205 | |||
206 | /** |
||
207 | * Returns the workbook reader |
||
208 | * |
||
209 | * @return SpreadsheetLoader |
||
210 | */ |
||
211 | protected function getWorkbookLoader() |
||
215 | |||
216 | /** |
||
217 | * Returns an iterator for the specified worksheet |
||
218 | * |
||
219 | * @param int $worksheetIndex |
||
220 | * |
||
221 | * @return \Iterator |
||
222 | */ |
||
223 | protected function createIterator($worksheetIndex) |
||
227 | |||
228 | /** |
||
229 | * Creates the value iterator |
||
230 | * |
||
231 | * @return Iterator |
||
232 | */ |
||
233 | abstract protected function createValuesIterator(); |
||
234 | } |
||
235 |