1 | <?php |
||
11 | class StyleRegistry extends \Box\Spout\Writer\Common\Manager\Style\StyleRegistry |
||
12 | { |
||
13 | /** |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $registeredFills = []; |
||
17 | |||
18 | /** |
||
19 | * @var array [STYLE_ID] => [FILL_ID] maps a style to a fill declaration |
||
20 | */ |
||
21 | protected $styleIdToFillMappingTable = []; |
||
22 | |||
23 | /** |
||
24 | * Excel preserves two default fills with index 0 and 1 |
||
25 | * Since Excel is the dominant vendor - we play along here |
||
26 | * |
||
27 | * @var int The fill index counter for custom fills. |
||
28 | */ |
||
29 | protected $fillIndex = 2; |
||
30 | |||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $registeredBorders = []; |
||
35 | |||
36 | /** |
||
37 | * @var array [STYLE_ID] => [BORDER_ID] maps a style to a border declaration |
||
38 | */ |
||
39 | protected $styleIdToBorderMappingTable = []; |
||
40 | |||
41 | /** |
||
42 | * XLSX specific operations on the registered styles |
||
43 | * |
||
44 | * @param Style $style |
||
45 | * @return Style |
||
46 | */ |
||
47 | 42 | public function registerStyle(Style $style) |
|
55 | |||
56 | /** |
||
57 | * Register a fill definition |
||
58 | * |
||
59 | * @param Style $style |
||
60 | */ |
||
61 | 42 | private function registerFill(Style $style) |
|
87 | |||
88 | /** |
||
89 | * @param int $styleId |
||
90 | * @return int|null Fill ID associated to the given style ID |
||
91 | */ |
||
92 | 14 | public function getFillIdForStyleId($styleId) |
|
98 | |||
99 | /** |
||
100 | * Register a border definition |
||
101 | * |
||
102 | * @param Style $style |
||
103 | */ |
||
104 | 42 | private function registerBorder(Style $style) |
|
127 | |||
128 | /** |
||
129 | * @param int $styleId |
||
130 | * @return int|null Fill ID associated to the given style ID |
||
131 | */ |
||
132 | 14 | public function getBorderIdForStyleId($styleId) |
|
138 | |||
139 | /** |
||
140 | * @return array |
||
141 | */ |
||
142 | 37 | public function getRegisteredFills() |
|
146 | |||
147 | /** |
||
148 | * @return array |
||
149 | */ |
||
150 | 37 | public function getRegisteredBorders() |
|
154 | } |
||
155 |