1 | <?php |
||
14 | class ReaderOptions extends ReaderOptionsCommon |
||
15 | { |
||
16 | /** @var string Defines the character used to delimit fields (one character only) */ |
||
17 | protected $fieldDelimiter = ','; |
||
18 | |||
19 | /** @var string Defines the character used to enclose fields (one character only) */ |
||
20 | protected $fieldEnclosure = '"'; |
||
21 | |||
22 | /** @var string Encoding of the CSV file to be read */ |
||
23 | protected $encoding = EncodingHelper::ENCODING_UTF8; |
||
24 | |||
25 | /** @var string Defines the End of line */ |
||
26 | protected $endOfLineCharacter = "\n"; |
||
27 | |||
28 | /** |
||
29 | * @return string |
||
30 | */ |
||
31 | 78 | public function getFieldDelimiter() |
|
35 | |||
36 | /** |
||
37 | * Sets the field delimiter for the CSV. |
||
38 | * Needs to be called before opening the reader. |
||
39 | * |
||
40 | * @param string $fieldDelimiter Character that delimits fields |
||
41 | * @return ReaderOptions |
||
42 | */ |
||
43 | 60 | public function setFieldDelimiter($fieldDelimiter) |
|
48 | |||
49 | /** |
||
50 | * @return string |
||
51 | */ |
||
52 | 78 | public function getFieldEnclosure() |
|
56 | |||
57 | /** |
||
58 | * Sets the field enclosure for the CSV. |
||
59 | * Needs to be called before opening the reader. |
||
60 | * |
||
61 | * @param string $fieldEnclosure Character that enclose fields |
||
62 | * @return ReaderOptions |
||
63 | */ |
||
64 | 60 | public function setFieldEnclosure($fieldEnclosure) |
|
69 | |||
70 | /** |
||
71 | * @return string |
||
72 | */ |
||
73 | 78 | public function getEncoding() |
|
77 | |||
78 | /** |
||
79 | * Sets the encoding of the CSV file to be read. |
||
80 | * Needs to be called before opening the reader. |
||
81 | * |
||
82 | * @param string $encoding Encoding of the CSV file to be read |
||
83 | * @return ReaderOptions |
||
84 | */ |
||
85 | 72 | public function setEncoding($encoding) |
|
90 | |||
91 | /** |
||
92 | * @return string EOL for the CSV |
||
93 | */ |
||
94 | 78 | public function getEndOfLineCharacter() |
|
98 | |||
99 | /** |
||
100 | * Sets the EOL for the CSV. |
||
101 | * Needs to be called before opening the reader. |
||
102 | * |
||
103 | * @param string $endOfLineCharacter used to properly get lines from the CSV file. |
||
104 | * @return ReaderOptions |
||
105 | */ |
||
106 | 60 | public function setEndOfLineCharacter($endOfLineCharacter) |
|
111 | } |
||
112 |