1 | <?php |
||
16 | class WriterEntityFactory |
||
17 | { |
||
18 | /** |
||
19 | * This creates an instance of the appropriate writer, given the type of the file to be written |
||
20 | * |
||
21 | * @param string $writerType Type of the writer to instantiate |
||
22 | * @throws \Box\Spout\Common\Exception\UnsupportedTypeException |
||
23 | * @return WriterInterface |
||
24 | */ |
||
25 | public static function createWriter($writerType) |
||
29 | |||
30 | /** |
||
31 | * This creates an instance of the appropriate writer, given the extension of the file to be written |
||
32 | * |
||
33 | * @param string $path The path to the spreadsheet file. Supported extensions are .csv, .ods and .xlsx |
||
34 | * @throws \Box\Spout\Common\Exception\UnsupportedTypeException |
||
35 | * @return WriterInterface |
||
36 | */ |
||
37 | public static function createWriterFromFile(string $path) |
||
41 | |||
42 | /** |
||
43 | * This creates an instance of a CSV writer |
||
44 | * |
||
45 | * @return \Box\Spout\Writer\CSV\Writer |
||
46 | */ |
||
47 | 11 | public static function createCSVWriter() |
|
55 | |||
56 | /** |
||
57 | * This creates an instance of a XLSX writer |
||
58 | * |
||
59 | * @return \Box\Spout\Writer\XLSX\Writer |
||
60 | */ |
||
61 | 48 | public static function createXLSXWriter() |
|
69 | |||
70 | /** |
||
71 | * This creates an instance of a ODS writer |
||
72 | * |
||
73 | * @return \Box\Spout\Writer\ODS\Writer |
||
74 | */ |
||
75 | 44 | public static function createODSWriter() |
|
83 | |||
84 | /** |
||
85 | * @param Cell[] $cells |
||
86 | * @param Style|null $rowStyle |
||
87 | * @return Row |
||
88 | */ |
||
89 | 4 | public static function createRow(array $cells = [], Style $rowStyle = null) |
|
93 | |||
94 | /** |
||
95 | * @param array $cellValues |
||
96 | * @param Style|null $rowStyle |
||
97 | * @return Row |
||
98 | */ |
||
99 | 83 | public static function createRowFromArray(array $cellValues = [], Style $rowStyle = null) |
|
107 | |||
108 | /** |
||
109 | * @param mixed $cellValue |
||
110 | * @param Style|null $cellStyle |
||
111 | * @return Cell |
||
112 | */ |
||
113 | 4 | public static function createCell($cellValue, Style $cellStyle = null) |
|
117 | } |
||
118 |