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\MediumInterface; |
8
|
|
|
use Loevgaard\DandomainFoundation\Entity\Generated\MediumTrait; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @ORM\Entity() |
12
|
|
|
* @ORM\Table(name="loevgaard_dandomain_media") |
13
|
|
|
*/ |
14
|
|
|
class Medium implements MediumInterface |
15
|
|
|
{ |
16
|
|
|
use MediumTrait; |
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 $height; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var array|null |
43
|
|
|
* |
44
|
|
|
* @ORM\Column(nullable=true, type="array") |
45
|
|
|
*/ |
46
|
|
|
protected $mediaTranslations; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var int|null |
50
|
|
|
* |
51
|
|
|
* @ORM\Column(nullable=true, type="integer") |
52
|
|
|
*/ |
53
|
|
|
protected $sortOrder; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @var string|null |
57
|
|
|
* |
58
|
|
|
* @ORM\Column(nullable=true, type="string") |
59
|
|
|
*/ |
60
|
|
|
protected $thumbnail; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @var string|null |
64
|
|
|
* |
65
|
|
|
* @ORM\Column(nullable=true, type="string") |
66
|
|
|
*/ |
67
|
|
|
protected $thumbnailHeight; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @var string|null |
71
|
|
|
* |
72
|
|
|
* @ORM\Column(nullable=true, type="string") |
73
|
|
|
*/ |
74
|
|
|
protected $thumbnailWidth; |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @var string|null |
78
|
|
|
* |
79
|
|
|
* @ORM\Column(nullable=true, type="string") |
80
|
|
|
*/ |
81
|
|
|
protected $url; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @var string|null |
85
|
|
|
* |
86
|
|
|
* @ORM\Column(nullable=true, type="string") |
87
|
|
|
*/ |
88
|
|
|
protected $width; |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @var Product[]|ArrayCollection |
92
|
|
|
*/ |
93
|
|
|
protected $products; |
94
|
|
|
|
95
|
|
|
public function __construct() |
96
|
|
|
{ |
97
|
|
|
$this->products = new ArrayCollection(); |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* @return int |
102
|
|
|
*/ |
103
|
|
|
public function getId(): int |
104
|
|
|
{ |
105
|
|
|
return (int)$this->id; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @param int $id |
110
|
|
|
* @return Medium |
111
|
|
|
*/ |
112
|
|
|
public function setId(int $id) |
113
|
|
|
{ |
114
|
|
|
$this->id = $id; |
115
|
|
|
return $this; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* @return int |
120
|
|
|
*/ |
121
|
|
|
public function getExternalId(): int |
122
|
|
|
{ |
123
|
|
|
return (int)$this->externalId; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @param int $externalId |
128
|
|
|
* @return Medium |
129
|
|
|
*/ |
130
|
|
|
public function setExternalId(int $externalId) |
131
|
|
|
{ |
132
|
|
|
$this->externalId = $externalId; |
133
|
|
|
return $this; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @return null|string |
138
|
|
|
*/ |
139
|
|
|
public function getHeight() |
140
|
|
|
{ |
141
|
|
|
return $this->height; |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @param null|string $height |
146
|
|
|
* @return Medium |
147
|
|
|
*/ |
148
|
|
|
public function setHeight($height) |
149
|
|
|
{ |
150
|
|
|
$this->height = $height; |
151
|
|
|
return $this; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* @return array|null |
156
|
|
|
*/ |
157
|
|
|
public function getMediaTranslations() |
158
|
|
|
{ |
159
|
|
|
return $this->mediaTranslations; |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* @param array|null $mediaTranslations |
164
|
|
|
* @return Medium |
165
|
|
|
*/ |
166
|
|
|
public function setMediaTranslations($mediaTranslations) |
167
|
|
|
{ |
168
|
|
|
$this->mediaTranslations = $mediaTranslations; |
169
|
|
|
return $this; |
170
|
|
|
} |
171
|
|
|
|
172
|
|
|
/** |
173
|
|
|
* @return int|null |
174
|
|
|
*/ |
175
|
|
|
public function getSortOrder() |
176
|
|
|
{ |
177
|
|
|
return $this->sortOrder; |
178
|
|
|
} |
179
|
|
|
|
180
|
|
|
/** |
181
|
|
|
* @param int|null $sortOrder |
182
|
|
|
* @return Medium |
183
|
|
|
*/ |
184
|
|
|
public function setSortOrder($sortOrder) |
185
|
|
|
{ |
186
|
|
|
$this->sortOrder = $sortOrder; |
187
|
|
|
return $this; |
188
|
|
|
} |
189
|
|
|
|
190
|
|
|
/** |
191
|
|
|
* @return null|string |
192
|
|
|
*/ |
193
|
|
|
public function getThumbnail() |
194
|
|
|
{ |
195
|
|
|
return $this->thumbnail; |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
/** |
199
|
|
|
* @param null|string $thumbnail |
200
|
|
|
* @return Medium |
201
|
|
|
*/ |
202
|
|
|
public function setThumbnail($thumbnail) |
203
|
|
|
{ |
204
|
|
|
$this->thumbnail = $thumbnail; |
205
|
|
|
return $this; |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* @return null|string |
210
|
|
|
*/ |
211
|
|
|
public function getThumbnailHeight() |
212
|
|
|
{ |
213
|
|
|
return $this->thumbnailHeight; |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
/** |
217
|
|
|
* @param null|string $thumbnailHeight |
218
|
|
|
* @return Medium |
219
|
|
|
*/ |
220
|
|
|
public function setThumbnailHeight($thumbnailHeight) |
221
|
|
|
{ |
222
|
|
|
$this->thumbnailHeight = $thumbnailHeight; |
223
|
|
|
return $this; |
224
|
|
|
} |
225
|
|
|
|
226
|
|
|
/** |
227
|
|
|
* @return null|string |
228
|
|
|
*/ |
229
|
|
|
public function getThumbnailWidth() |
230
|
|
|
{ |
231
|
|
|
return $this->thumbnailWidth; |
232
|
|
|
} |
233
|
|
|
|
234
|
|
|
/** |
235
|
|
|
* @param null|string $thumbnailWidth |
236
|
|
|
* @return Medium |
237
|
|
|
*/ |
238
|
|
|
public function setThumbnailWidth($thumbnailWidth) |
239
|
|
|
{ |
240
|
|
|
$this->thumbnailWidth = $thumbnailWidth; |
241
|
|
|
return $this; |
242
|
|
|
} |
243
|
|
|
|
244
|
|
|
/** |
245
|
|
|
* @return null|string |
246
|
|
|
*/ |
247
|
|
|
public function getUrl() |
248
|
|
|
{ |
249
|
|
|
return $this->url; |
250
|
|
|
} |
251
|
|
|
|
252
|
|
|
/** |
253
|
|
|
* @param null|string $url |
254
|
|
|
* @return Medium |
255
|
|
|
*/ |
256
|
|
|
public function setUrl($url) |
257
|
|
|
{ |
258
|
|
|
$this->url = $url; |
259
|
|
|
return $this; |
260
|
|
|
} |
261
|
|
|
|
262
|
|
|
/** |
263
|
|
|
* @return null|string |
264
|
|
|
*/ |
265
|
|
|
public function getWidth() |
266
|
|
|
{ |
267
|
|
|
return $this->width; |
268
|
|
|
} |
269
|
|
|
|
270
|
|
|
/** |
271
|
|
|
* @param null|string $width |
272
|
|
|
* @return Medium |
273
|
|
|
*/ |
274
|
|
|
public function setWidth($width) |
275
|
|
|
{ |
276
|
|
|
$this->width = $width; |
277
|
|
|
return $this; |
278
|
|
|
} |
279
|
|
|
|
280
|
|
|
/** |
281
|
|
|
* @return ArrayCollection|Product[] |
282
|
|
|
*/ |
283
|
|
|
public function getProducts() |
284
|
|
|
{ |
285
|
|
|
return $this->products; |
286
|
|
|
} |
287
|
|
|
|
288
|
|
|
/** |
289
|
|
|
* @param ArrayCollection|Product[] $products |
290
|
|
|
* @return Medium |
291
|
|
|
*/ |
292
|
|
|
public function setProducts($products) |
293
|
|
|
{ |
294
|
|
|
$this->products = $products; |
295
|
|
|
return $this; |
296
|
|
|
} |
297
|
|
|
} |
298
|
|
|
|