1 | <?php |
||
8 | class IteratorFileCsv extends AbstractIteratorFile implements IteratorInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var array|null |
||
12 | */ |
||
13 | protected $headers; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $delimiter; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $enclosure; |
||
24 | |||
25 | /** |
||
26 | * @var string|null |
||
27 | */ |
||
28 | protected $escape; |
||
29 | |||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $defaults = array(); |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $replace = array(); |
||
39 | |||
40 | const DELIMITER_DEFAULT = ';'; |
||
41 | const ENCLOSURE_DEFAULT = '"'; |
||
42 | const ESCAPE_DEFAULT = '\\'; |
||
43 | |||
44 | /** |
||
45 | * Abre o arquivo para leitura e define a variaveis |
||
46 | * |
||
47 | * @param string $fileName File Name |
||
48 | * @param string $headers Headers [optional] |
||
49 | * @param string $delimiter Separator Fields [optional] |
||
50 | * @param string $enclosure Enclosure Fields [optional] |
||
51 | * @param string $escape String de Escape [optional] |
||
52 | * |
||
53 | * @throws \RuntimeException |
||
54 | */ |
||
55 | 4 | public function __construct( |
|
69 | |||
70 | /** |
||
71 | * Line to array |
||
72 | * |
||
73 | * @return array|null |
||
74 | */ |
||
75 | 2 | private function rowArray() |
|
90 | |||
91 | /** |
||
92 | * Make Row Current |
||
93 | * |
||
94 | * @return array|bool |
||
95 | */ |
||
96 | 1 | public function makeCurrent() |
|
128 | |||
129 | /** |
||
130 | * Conta as linhas como csv |
||
131 | * |
||
132 | * @return integer |
||
133 | */ |
||
134 | 1 | public function count() |
|
147 | |||
148 | /** |
||
149 | * Rewind na segunda linha |
||
150 | * |
||
151 | * @see FileIterator::rewind() |
||
152 | * @return void |
||
153 | */ |
||
154 | 1 | public function rewind() |
|
160 | |||
161 | /** |
||
162 | * Retorna o headers tendo como chave a posicao das colunas da planilha |
||
163 | * |
||
164 | * @return array |
||
165 | */ |
||
166 | 2 | public function getHeaders() |
|
186 | |||
187 | /** |
||
188 | * Set Headers |
||
189 | * |
||
190 | * @param array $headers Headers |
||
191 | * |
||
192 | * @return IteratorFileCsv |
||
193 | */ |
||
194 | 4 | public function setHeaders(array $headers) |
|
199 | |||
200 | /** |
||
201 | * Set Fields Defaults |
||
202 | * |
||
203 | * @param array $defaults Defaults |
||
204 | * |
||
205 | * @return void |
||
206 | */ |
||
207 | 1 | public function setDefaults(array $defaults) |
|
212 | |||
213 | /** |
||
214 | * Set Fields Replace |
||
215 | * |
||
216 | * @param array $replace Replaces |
||
217 | * |
||
218 | * @return void |
||
219 | */ |
||
220 | 1 | public function setReplace(array $replace) |
|
225 | } |
||
226 |
This function has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.