1 | <?php |
||
13 | class StyleRegistry extends \Box\Spout\Writer\Common\Manager\Style\StyleRegistry |
||
14 | { |
||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $registeredFills = []; |
||
19 | |||
20 | /** |
||
21 | * @var array [STYLE_ID] => [FILL_ID] maps a style to a fill declaration |
||
22 | */ |
||
23 | protected $styleIdToFillMappingTable = []; |
||
24 | |||
25 | /** |
||
26 | * Excel preserves two default fills with index 0 and 1 |
||
27 | * Since Excel is the dominant vendor - we play along here |
||
28 | * |
||
29 | * @var int The fill index counter for custom fills. |
||
30 | */ |
||
31 | protected $fillIndex = 2; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $registeredBorders = []; |
||
37 | |||
38 | /** |
||
39 | * @var array [STYLE_ID] => [BORDER_ID] maps a style to a border declaration |
||
40 | */ |
||
41 | protected $styleIdToBorderMappingTable = []; |
||
42 | |||
43 | /** |
||
44 | * XLSX specific operations on the registered styles |
||
45 | * |
||
46 | * @param Style $style |
||
47 | * @return Style |
||
48 | */ |
||
49 | 48 | public function registerStyle(Style $style) |
|
57 | |||
58 | /** |
||
59 | * Register a fill definition |
||
60 | * |
||
61 | * @param Style $style |
||
62 | */ |
||
63 | 48 | private function registerFill(Style $style) |
|
90 | |||
91 | /** |
||
92 | * @param int $styleId |
||
93 | * @return int|null Fill ID associated to the given style ID |
||
94 | */ |
||
95 | 37 | public function getFillIdForStyleId($styleId) |
|
101 | |||
102 | /** |
||
103 | * Register a border definition |
||
104 | * |
||
105 | * @param Style $style |
||
106 | */ |
||
107 | 48 | private function registerBorder(Style $style) |
|
131 | |||
132 | /** |
||
133 | * @param int $styleId |
||
134 | * @return int|null Fill ID associated to the given style ID |
||
135 | */ |
||
136 | 37 | public function getBorderIdForStyleId($styleId) |
|
142 | |||
143 | /** |
||
144 | * @return array |
||
145 | */ |
||
146 | 37 | public function getRegisteredFills() |
|
150 | |||
151 | /** |
||
152 | * @return array |
||
153 | */ |
||
154 | 37 | public function getRegisteredBorders() |
|
158 | } |
||
159 |