1
|
|
|
<?php |
2
|
|
|
namespace Ellumilel; |
3
|
|
|
|
4
|
|
|
class Sheet |
5
|
|
|
{ |
6
|
|
|
/** @var string */ |
7
|
|
|
private $filename; |
8
|
|
|
/** @var string */ |
9
|
|
|
private $sheetName; |
10
|
|
|
/** @var string */ |
11
|
|
|
private $xmlName; |
12
|
|
|
/** @var int */ |
13
|
|
|
private $rowCount = 0; |
14
|
|
|
/** @var Writer */ |
15
|
|
|
private $writer; |
16
|
|
|
/** @var array */ |
17
|
|
|
private $columns = []; |
18
|
|
|
/** @var array */ |
19
|
|
|
private $mergeCells = []; |
20
|
|
|
/** @var int */ |
21
|
|
|
private $maxCellTagStart = 0; |
22
|
|
|
/** @var int */ |
23
|
|
|
private $maxCellTagEnd = 0; |
24
|
|
|
/** @var bool */ |
25
|
|
|
private $finalized = false; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @return string |
29
|
|
|
*/ |
30
|
|
|
public function getFilename() |
31
|
|
|
{ |
32
|
|
|
return $this->filename; |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @param string $filename |
37
|
|
|
* |
38
|
|
|
* @return $this |
39
|
|
|
*/ |
40
|
|
|
public function setFilename($filename) |
41
|
|
|
{ |
42
|
|
|
$this->filename = $filename; |
43
|
|
|
|
44
|
|
|
return $this; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @return string |
49
|
|
|
*/ |
50
|
|
|
public function getSheetName() |
51
|
|
|
{ |
52
|
|
|
return $this->sheetName; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @param string $sheetName |
57
|
|
|
* |
58
|
|
|
* @return $this |
59
|
|
|
*/ |
60
|
|
|
public function setSheetName($sheetName) |
61
|
|
|
{ |
62
|
|
|
$this->sheetName = $sheetName; |
63
|
|
|
|
64
|
|
|
return $this; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @return string |
69
|
|
|
*/ |
70
|
|
|
public function getXmlName() |
71
|
|
|
{ |
72
|
|
|
return $this->xmlName; |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @param string $xmlName |
77
|
|
|
* |
78
|
|
|
* @return $this |
79
|
|
|
*/ |
80
|
|
|
public function setXmlName($xmlName) |
81
|
|
|
{ |
82
|
|
|
$this->xmlName = $xmlName; |
83
|
|
|
|
84
|
|
|
return $this; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @return int |
89
|
|
|
*/ |
90
|
|
|
public function getRowCount() |
91
|
|
|
{ |
92
|
|
|
return $this->rowCount; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @param int $rowCount |
97
|
|
|
* |
98
|
|
|
* @return $this |
99
|
|
|
*/ |
100
|
|
|
public function setRowCount($rowCount) |
101
|
|
|
{ |
102
|
|
|
$this->rowCount = $rowCount; |
103
|
|
|
|
104
|
|
|
return $this; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @return int |
109
|
|
|
*/ |
110
|
|
|
public function increaseRowCount() |
111
|
|
|
{ |
112
|
|
|
return $this->rowCount++; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @return Writer |
117
|
|
|
*/ |
118
|
|
|
public function getWriter() |
119
|
|
|
{ |
120
|
|
|
return $this->writer; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* @param Writer $writer |
125
|
|
|
* |
126
|
|
|
* @return $this |
127
|
|
|
*/ |
128
|
|
|
public function setWriter(Writer $writer) |
129
|
|
|
{ |
130
|
|
|
$this->writer = $writer; |
131
|
|
|
|
132
|
|
|
return $this; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* @return array |
137
|
|
|
*/ |
138
|
|
|
public function getColumns() |
139
|
|
|
{ |
140
|
|
|
return $this->columns; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @param array $column |
145
|
|
|
* |
146
|
|
|
* @return $this |
147
|
|
|
*/ |
148
|
|
|
public function setColumn($column) |
149
|
|
|
{ |
150
|
|
|
$this->columns[] = $column; |
151
|
|
|
|
152
|
|
|
return $this; |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
/** |
156
|
|
|
* @param array $columns |
157
|
|
|
* |
158
|
|
|
* @return $this |
159
|
|
|
*/ |
160
|
|
|
public function setColumns(array $columns) |
161
|
|
|
{ |
162
|
|
|
$this->columns = $columns; |
163
|
|
|
|
164
|
|
|
return $this; |
165
|
|
|
} |
166
|
|
|
|
167
|
|
|
/** |
168
|
|
|
* @return array |
169
|
|
|
*/ |
170
|
|
|
public function getMergeCells() |
171
|
|
|
{ |
172
|
|
|
return $this->mergeCells; |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* @param array $mergeCells |
177
|
|
|
* |
178
|
|
|
* @return $this |
179
|
|
|
*/ |
180
|
|
|
public function setMergeCells(array $mergeCells) |
181
|
|
|
{ |
182
|
|
|
$this->mergeCells = $mergeCells; |
183
|
|
|
|
184
|
|
|
return $this; |
185
|
|
|
} |
186
|
|
|
|
187
|
|
|
/** |
188
|
|
|
* @return int |
189
|
|
|
*/ |
190
|
|
|
public function getMaxCellTagStart() |
191
|
|
|
{ |
192
|
|
|
return $this->maxCellTagStart; |
193
|
|
|
} |
194
|
|
|
|
195
|
|
|
/** |
196
|
|
|
* @param int $maxCellTagStart |
197
|
|
|
* |
198
|
|
|
* @return $this |
199
|
|
|
*/ |
200
|
|
|
public function setMaxCellTagStart($maxCellTagStart) |
201
|
|
|
{ |
202
|
|
|
$this->maxCellTagStart = $maxCellTagStart; |
203
|
|
|
|
204
|
|
|
return $this; |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
/** |
208
|
|
|
* @return int |
209
|
|
|
*/ |
210
|
|
|
public function getMaxCellTagEnd() |
211
|
|
|
{ |
212
|
|
|
return $this->maxCellTagEnd; |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* @param int $maxCellTagEnd |
217
|
|
|
* |
218
|
|
|
* @return $this |
219
|
|
|
*/ |
220
|
|
|
public function setMaxCellTagEnd($maxCellTagEnd) |
221
|
|
|
{ |
222
|
|
|
$this->maxCellTagEnd = $maxCellTagEnd; |
223
|
|
|
|
224
|
|
|
return $this; |
225
|
|
|
} |
226
|
|
|
|
227
|
|
|
/** |
228
|
|
|
* @return bool |
229
|
|
|
*/ |
230
|
|
|
public function getFinalized() |
231
|
|
|
{ |
232
|
|
|
return $this->finalized; |
233
|
|
|
} |
234
|
|
|
|
235
|
|
|
/** |
236
|
|
|
* @param bool $finalized |
237
|
|
|
* |
238
|
|
|
* @return $this |
239
|
|
|
*/ |
240
|
|
|
public function setFinalized($finalized) |
241
|
|
|
{ |
242
|
|
|
$this->finalized = $finalized; |
243
|
|
|
|
244
|
|
|
return $this; |
245
|
|
|
} |
246
|
|
|
} |
247
|
|
|
|