1 | <?php |
||
13 | class Writer |
||
14 | { |
||
15 | /** |
||
16 | * @var SheetFile |
||
17 | */ |
||
18 | private $sheetFile; |
||
19 | |||
20 | /** |
||
21 | * @var Styler |
||
22 | */ |
||
23 | private $styler; |
||
24 | |||
25 | /** |
||
26 | * @var Sheet |
||
27 | */ |
||
28 | private $sheet; |
||
29 | |||
30 | /** |
||
31 | * Writer constructor. |
||
32 | */ |
||
33 | 2 | public function __construct() |
|
37 | |||
38 | /** |
||
39 | * All cells _above_ this cell will be fozen/fixed. |
||
40 | * |
||
41 | * @param int $cellId |
||
42 | */ |
||
43 | public function setfreezePaneCellId($cellId) |
||
47 | |||
48 | /** |
||
49 | * Set fixed column widths per cell (no ranges) and array index |
||
50 | * 0 beeing the first column. |
||
51 | * If used alongside cell autosizing, these should be set |
||
52 | * after the last row has been added. |
||
53 | * |
||
54 | * @param array $columnWidths |
||
55 | * @throws \InvalidArgumentException |
||
56 | */ |
||
57 | public function setFixedColumnWidths(array $columnWidths) |
||
61 | |||
62 | /** |
||
63 | * Start recording row specs for column autosizing. |
||
64 | * |
||
65 | * @return Writer |
||
66 | */ |
||
67 | 1 | public function enableCellAutosizing() |
|
72 | |||
73 | /** |
||
74 | * Stop recording row specs for column autosizing. |
||
75 | * |
||
76 | * @return Writer |
||
77 | */ |
||
78 | public function disableCellAutosizing() |
||
83 | |||
84 | /** |
||
85 | * Initialize writer defaults. |
||
86 | */ |
||
87 | 2 | private function initialize() |
|
94 | |||
95 | /** |
||
96 | * @param array $rows |
||
97 | * @param Style $style |
||
98 | * @throws \InvalidArgumentException |
||
99 | */ |
||
100 | 2 | public function addRows(array $rows, Style $style = null) |
|
110 | |||
111 | /** |
||
112 | * @param array $row |
||
113 | * @param Style $style |
||
114 | */ |
||
115 | 1 | public function addRow(array $row, Style $style = null) |
|
121 | |||
122 | /** |
||
123 | * Wrap things up and write/output xlsx. |
||
124 | * |
||
125 | * @param string $fileName |
||
126 | */ |
||
127 | 1 | public function writeToFile($fileName = 'dummy.xlsx') |
|
132 | } |
||
133 |