1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace PhpOffice\PhpSpreadsheet\Worksheet\Table; |
4
|
|
|
|
5
|
|
|
use PhpOffice\PhpSpreadsheet\Style\Style; |
6
|
|
|
use PhpOffice\PhpSpreadsheet\Worksheet\Table; |
7
|
|
|
|
8
|
|
|
class TableDxfsStyle |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* Header row dxfs index. |
12
|
|
|
*/ |
13
|
|
|
private ?int $headerRow = null; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* First row stripe dxfs index. |
17
|
|
|
*/ |
18
|
|
|
private ?int $firstRowStripe = null; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* second row stripe dxfs index. |
22
|
|
|
*/ |
23
|
|
|
private ?int $secondRowStripe = null; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Header row Style. |
27
|
|
|
*/ |
28
|
|
|
private ?Style $headerRowStyle = null; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* First row stripe Style. |
32
|
|
|
*/ |
33
|
|
|
private ?Style $firstRowStripeStyle = null; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Second row stripe Style. |
37
|
|
|
*/ |
38
|
|
|
private ?Style $secondRowStripeStyle = null; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Name of the style. |
42
|
|
|
*/ |
43
|
|
|
private string $name; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* Create a new Table Style. |
47
|
|
|
* |
48
|
|
|
* @param string $name The name |
49
|
|
|
*/ |
50
|
4 |
|
public function __construct(string $name) |
51
|
|
|
{ |
52
|
4 |
|
$this->name = $name; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Get name. |
57
|
|
|
*/ |
58
|
4 |
|
public function getName(): string |
59
|
|
|
{ |
60
|
4 |
|
return $this->name; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Set header row dxfs index. |
65
|
|
|
*/ |
66
|
3 |
|
public function setHeaderRow(int $row): self |
67
|
|
|
{ |
68
|
3 |
|
$this->headerRow = $row; |
69
|
|
|
|
70
|
3 |
|
return $this; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* Get header row dxfs index. |
75
|
|
|
*/ |
76
|
4 |
|
public function getHeaderRow(): ?int |
77
|
|
|
{ |
78
|
4 |
|
return $this->headerRow; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* Set first row stripe dxfs index. |
83
|
|
|
*/ |
84
|
4 |
|
public function setFirstRowStripe(int $row): self |
85
|
|
|
{ |
86
|
4 |
|
$this->firstRowStripe = $row; |
87
|
|
|
|
88
|
4 |
|
return $this; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* Get first row stripe dxfs index. |
93
|
|
|
*/ |
94
|
4 |
|
public function getFirstRowStripe(): ?int |
95
|
|
|
{ |
96
|
4 |
|
return $this->firstRowStripe; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* Set second row stripe dxfs index. |
101
|
|
|
*/ |
102
|
4 |
|
public function setSecondRowStripe(int $row): self |
103
|
|
|
{ |
104
|
4 |
|
$this->secondRowStripe = $row; |
105
|
|
|
|
106
|
4 |
|
return $this; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* Get second row stripe dxfs index. |
111
|
|
|
*/ |
112
|
4 |
|
public function getSecondRowStripe(): ?int |
113
|
|
|
{ |
114
|
4 |
|
return $this->secondRowStripe; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* Set Header row Style. |
119
|
|
|
*/ |
120
|
3 |
|
public function setHeaderRowStyle(Style $style): self |
121
|
|
|
{ |
122
|
3 |
|
$this->headerRowStyle = $style; |
123
|
|
|
|
124
|
3 |
|
return $this; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* Get Header row Style. |
129
|
|
|
*/ |
130
|
2 |
|
public function getHeaderRowStyle(): ?Style |
131
|
|
|
{ |
132
|
2 |
|
return $this->headerRowStyle; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* Set first row stripe Style. |
137
|
|
|
*/ |
138
|
4 |
|
public function setFirstRowStripeStyle(Style $style): self |
139
|
|
|
{ |
140
|
4 |
|
$this->firstRowStripeStyle = $style; |
141
|
|
|
|
142
|
4 |
|
return $this; |
143
|
|
|
} |
144
|
|
|
|
145
|
|
|
/** |
146
|
|
|
* Get first row stripe Style. |
147
|
|
|
*/ |
148
|
2 |
|
public function getFirstRowStripeStyle(): ?Style |
149
|
|
|
{ |
150
|
2 |
|
return $this->firstRowStripeStyle; |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* Set second row stripe Style. |
155
|
|
|
*/ |
156
|
4 |
|
public function setSecondRowStripeStyle(Style $style): self |
157
|
|
|
{ |
158
|
4 |
|
$this->secondRowStripeStyle = $style; |
159
|
|
|
|
160
|
4 |
|
return $this; |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* Get second row stripe Style. |
165
|
|
|
*/ |
166
|
2 |
|
public function getSecondRowStripeStyle(): ?Style |
167
|
|
|
{ |
168
|
2 |
|
return $this->secondRowStripeStyle; |
169
|
|
|
} |
170
|
|
|
} |
171
|
|
|
|