1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Loevgaard\DandomainFoundation\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
6
|
|
|
use Doctrine\ORM\Mapping as ORM; |
7
|
|
|
use Loevgaard\DandomainFoundation\Entity\Generated\VariantGroupInterface; |
8
|
|
|
use Loevgaard\DandomainFoundation\Entity\Generated\VariantGroupTrait; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @ORM\Entity() |
12
|
|
|
* @ORM\Table(name="loevgaard_dandomain_variant_groups") |
13
|
|
|
*/ |
14
|
|
|
class VariantGroup implements VariantGroupInterface |
15
|
|
|
{ |
16
|
|
|
use VariantGroupTrait; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @var int |
20
|
|
|
* |
21
|
|
|
* @ORM\Id |
22
|
|
|
* @ORM\GeneratedValue |
23
|
|
|
* @ORM\Column(type="integer") |
24
|
|
|
**/ |
25
|
|
|
protected $id; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var int |
29
|
|
|
* |
30
|
|
|
* @ORM\Column(type="integer", unique=true) |
31
|
|
|
*/ |
32
|
|
|
protected $externalId; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var string|null |
36
|
|
|
* |
37
|
|
|
* @ORM\Column(nullable=true, type="string") |
38
|
|
|
*/ |
39
|
|
|
protected $groupName; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var string|null |
43
|
|
|
* |
44
|
|
|
* @ORM\Column(nullable=true, type="string") |
45
|
|
|
*/ |
46
|
|
|
protected $headline; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var string|null |
50
|
|
|
* |
51
|
|
|
* @ORM\Column(nullable=true, type="text") |
52
|
|
|
*/ |
53
|
|
|
protected $selectText; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @var int|null |
57
|
|
|
* |
58
|
|
|
* @ORM\Column(nullable=true, type="integer") |
59
|
|
|
*/ |
60
|
|
|
protected $siteId; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @var int|null |
64
|
|
|
* |
65
|
|
|
* @ORM\Column(nullable=true, type="integer") |
66
|
|
|
*/ |
67
|
|
|
protected $sortOrder; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @var string|null |
71
|
|
|
* |
72
|
|
|
* @ORM\Column(nullable=true, type="text") |
73
|
|
|
*/ |
74
|
|
|
protected $text; |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @var int|null |
78
|
|
|
* |
79
|
|
|
* @ORM\Column(nullable=true, type="integer") |
80
|
|
|
*/ |
81
|
|
|
protected $variantType; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @var Product[]|ArrayCollection |
85
|
|
|
*/ |
86
|
|
|
protected $products; |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @var Variant[]|ArrayCollection |
90
|
|
|
*/ |
91
|
|
|
protected $variants; |
92
|
|
|
|
93
|
|
|
public function __construct() |
94
|
|
|
{ |
95
|
|
|
$this->products = new ArrayCollection(); |
96
|
|
|
$this->variants = new ArrayCollection(); |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @return int |
101
|
|
|
*/ |
102
|
|
|
public function getId(): int |
103
|
|
|
{ |
104
|
|
|
return (int)$this->id; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @param int $id |
109
|
|
|
* @return VariantGroup |
110
|
|
|
*/ |
111
|
|
|
public function setId(int $id) |
112
|
|
|
{ |
113
|
|
|
$this->id = $id; |
114
|
|
|
return $this; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @return int |
119
|
|
|
*/ |
120
|
|
|
public function getExternalId(): int |
121
|
|
|
{ |
122
|
|
|
return (int)$this->externalId; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* @param int $externalId |
127
|
|
|
* @return VariantGroup |
128
|
|
|
*/ |
129
|
|
|
public function setExternalId(int $externalId) |
130
|
|
|
{ |
131
|
|
|
$this->externalId = $externalId; |
132
|
|
|
return $this; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* @return null|string |
137
|
|
|
*/ |
138
|
|
|
public function getGroupName() |
139
|
|
|
{ |
140
|
|
|
return $this->groupName; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @param null|string $groupName |
145
|
|
|
* @return VariantGroup |
146
|
|
|
*/ |
147
|
|
|
public function setGroupName($groupName) |
148
|
|
|
{ |
149
|
|
|
$this->groupName = $groupName; |
150
|
|
|
return $this; |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* @return null|string |
155
|
|
|
*/ |
156
|
|
|
public function getHeadline() |
157
|
|
|
{ |
158
|
|
|
return $this->headline; |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* @param null|string $headline |
163
|
|
|
* @return VariantGroup |
164
|
|
|
*/ |
165
|
|
|
public function setHeadline($headline) |
166
|
|
|
{ |
167
|
|
|
$this->headline = $headline; |
168
|
|
|
return $this; |
169
|
|
|
} |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* @return null|string |
173
|
|
|
*/ |
174
|
|
|
public function getSelectText() |
175
|
|
|
{ |
176
|
|
|
return $this->selectText; |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
/** |
180
|
|
|
* @param null|string $selectText |
181
|
|
|
* @return VariantGroup |
182
|
|
|
*/ |
183
|
|
|
public function setSelectText($selectText) |
184
|
|
|
{ |
185
|
|
|
$this->selectText = $selectText; |
186
|
|
|
return $this; |
187
|
|
|
} |
188
|
|
|
|
189
|
|
|
/** |
190
|
|
|
* @return int|null |
191
|
|
|
*/ |
192
|
|
|
public function getSiteId() |
193
|
|
|
{ |
194
|
|
|
return $this->siteId; |
195
|
|
|
} |
196
|
|
|
|
197
|
|
|
/** |
198
|
|
|
* @param int|null $siteId |
199
|
|
|
* @return VariantGroup |
200
|
|
|
*/ |
201
|
|
|
public function setSiteId($siteId) |
202
|
|
|
{ |
203
|
|
|
$this->siteId = $siteId; |
204
|
|
|
return $this; |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
/** |
208
|
|
|
* @return int|null |
209
|
|
|
*/ |
210
|
|
|
public function getSortOrder() |
211
|
|
|
{ |
212
|
|
|
return $this->sortOrder; |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* @param int|null $sortOrder |
217
|
|
|
* @return VariantGroup |
218
|
|
|
*/ |
219
|
|
|
public function setSortOrder($sortOrder) |
220
|
|
|
{ |
221
|
|
|
$this->sortOrder = $sortOrder; |
222
|
|
|
return $this; |
223
|
|
|
} |
224
|
|
|
|
225
|
|
|
/** |
226
|
|
|
* @return null|string |
227
|
|
|
*/ |
228
|
|
|
public function getText() |
229
|
|
|
{ |
230
|
|
|
return $this->text; |
231
|
|
|
} |
232
|
|
|
|
233
|
|
|
/** |
234
|
|
|
* @param null|string $text |
235
|
|
|
* @return VariantGroup |
236
|
|
|
*/ |
237
|
|
|
public function setText($text) |
238
|
|
|
{ |
239
|
|
|
$this->text = $text; |
240
|
|
|
return $this; |
241
|
|
|
} |
242
|
|
|
|
243
|
|
|
/** |
244
|
|
|
* @return int|null |
245
|
|
|
*/ |
246
|
|
|
public function getVariantType() |
247
|
|
|
{ |
248
|
|
|
return $this->variantType; |
249
|
|
|
} |
250
|
|
|
|
251
|
|
|
/** |
252
|
|
|
* @param int|null $variantType |
253
|
|
|
* @return VariantGroup |
254
|
|
|
*/ |
255
|
|
|
public function setVariantType($variantType) |
256
|
|
|
{ |
257
|
|
|
$this->variantType = $variantType; |
258
|
|
|
return $this; |
259
|
|
|
} |
260
|
|
|
|
261
|
|
|
/** |
262
|
|
|
* @return ArrayCollection|Product[] |
263
|
|
|
*/ |
264
|
|
|
public function getProducts() |
265
|
|
|
{ |
266
|
|
|
return $this->products; |
267
|
|
|
} |
268
|
|
|
|
269
|
|
|
/** |
270
|
|
|
* @param ArrayCollection|Product[] $products |
271
|
|
|
* @return VariantGroup |
272
|
|
|
*/ |
273
|
|
|
public function setProducts($products) |
274
|
|
|
{ |
275
|
|
|
$this->products = $products; |
276
|
|
|
return $this; |
277
|
|
|
} |
278
|
|
|
|
279
|
|
|
/** |
280
|
|
|
* @return ArrayCollection|Variant[] |
281
|
|
|
*/ |
282
|
|
|
public function getVariants() |
283
|
|
|
{ |
284
|
|
|
return $this->variants; |
285
|
|
|
} |
286
|
|
|
|
287
|
|
|
/** |
288
|
|
|
* @param ArrayCollection|Variant[] $variants |
289
|
|
|
* @return VariantGroup |
290
|
|
|
*/ |
291
|
|
|
public function setVariants($variants) |
292
|
|
|
{ |
293
|
|
|
$this->variants = $variants; |
294
|
|
|
return $this; |
295
|
|
|
} |
296
|
|
|
} |
297
|
|
|
|