1 | <?php |
||
12 | class CsvWriter |
||
13 | { |
||
14 | /** |
||
15 | * @var resource |
||
16 | */ |
||
17 | private $out; |
||
18 | |||
19 | /** |
||
20 | * @var callable |
||
21 | */ |
||
22 | private $columnFilter; |
||
23 | |||
24 | public function __construct($columnFilter = null) |
||
29 | |||
30 | public function __destruct() |
||
34 | |||
35 | /** |
||
36 | * WRites the csv to stdout. |
||
37 | * |
||
38 | * @param array|\Traversable $row |
||
39 | */ |
||
40 | public function writeRow($row) |
||
64 | |||
65 | /** |
||
66 | * Encloses the column value. |
||
67 | * |
||
68 | * @param string $column |
||
69 | * |
||
70 | * @return string |
||
71 | */ |
||
72 | private static function encloseColumn($column) |
||
76 | } |
||
77 |