| 1 |
<?php |
| 2 |
|
| 3 |
namespace OpenSpout\Writer\CSV\Manager; |
| 4 |
|
| 5 |
use OpenSpout\Common\Manager\OptionsManagerAbstract; |
| 6 |
use OpenSpout\Writer\Common\Entity\Options; |
| 7 |
|
| 8 |
/** |
| 9 |
* CSV Writer options manager. |
| 10 |
*/ |
| 11 |
class OptionsManager extends OptionsManagerAbstract |
| 12 |
{ |
| 13 |
/** |
| 14 |
* {@inheritdoc} |
| 15 |
*/ |
| 16 |
protected function getSupportedOptions() |
| 17 |
{ |
| 18 |
return [ |
| 19 |
Options::FIELD_DELIMITER, |
| 20 |
Options::FIELD_ENCLOSURE, |
| 21 |
Options::SHOULD_ADD_BOM, |
| 22 |
]; |
| 23 |
} |
| 24 |
|
| 25 |
/** |
| 26 |
* {@inheritdoc} |
| 27 |
*/ |
| 28 |
protected function setDefaultOptions() |
| 29 |
{ |
| 30 |
$this->setOption(Options::FIELD_DELIMITER, ','); |
| 31 |
$this->setOption(Options::FIELD_ENCLOSURE, '"'); |
| 32 |
$this->setOption(Options::SHOULD_ADD_BOM, true); |
| 33 |
} |
| 34 |
} |
| 35 |
|