1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace MediaMonks\SonataMediaBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use MediaMonks\SonataMediaBundle\Model\MediaInterface; |
7
|
|
|
use MediaMonks\SonataMediaBundle\Model\MediaTrait; |
8
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @ORM\Entity(repositoryClass="MediaRepository") |
12
|
|
|
* @ORM\Table(name="media") |
13
|
|
|
*/ |
14
|
|
|
class Media implements MediaInterface |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* @ORM\Column(name="id", type="integer") |
18
|
|
|
* @ORM\Id |
19
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
20
|
|
|
*/ |
21
|
|
|
private $id; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @ORM\Column(type="string", nullable=true) |
25
|
|
|
*/ |
26
|
|
|
private $title; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @ORM\Column(type="text", nullable=true) |
30
|
|
|
*/ |
31
|
|
|
private $description; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @ORM\Column(type="string") |
35
|
|
|
*/ |
36
|
|
|
private $providerName; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @ORM\Column(type="string") |
40
|
|
|
*/ |
41
|
|
|
private $providerReference; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @ORM\Column(type="json_array") |
45
|
|
|
*/ |
46
|
|
|
private $providerMetaData = []; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @ORM\Column(type="string", nullable=true) |
50
|
|
|
*/ |
51
|
|
|
private $image; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @ORM\Column(type="json_array") |
55
|
|
|
*/ |
56
|
|
|
private $imageMetaData = []; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @ORM\Column(type="string", nullable=true) |
60
|
|
|
*/ |
61
|
|
|
private $pointOfInterest; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @ORM\Column(type="string", nullable=true) |
65
|
|
|
*/ |
66
|
|
|
private $copyright; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @ORM\Column(type="string", nullable=true) |
70
|
|
|
*/ |
71
|
|
|
private $authorName; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @var \DateTime |
75
|
|
|
* @ORM\Column(type="datetime") |
76
|
|
|
*/ |
77
|
|
|
private $createdAt; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @var \DateTime |
81
|
|
|
* @ORM\Column(type="datetime") |
82
|
|
|
*/ |
83
|
|
|
private $updatedAt; |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* @var string |
87
|
|
|
*/ |
88
|
|
|
private $binaryContent; |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @var string |
92
|
|
|
*/ |
93
|
|
|
private $imageContent; |
94
|
|
|
|
95
|
|
|
public function __construct() |
96
|
|
|
{ |
97
|
|
|
$this->createdAt = new \DateTime; |
98
|
|
|
$this->updatedAt = new \DateTime; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* @return mixed |
103
|
|
|
*/ |
104
|
|
|
public function getId() |
105
|
|
|
{ |
106
|
|
|
return $this->id; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @param mixed $id |
111
|
|
|
*/ |
112
|
|
|
public function setId($id) |
113
|
|
|
{ |
114
|
|
|
$this->id = $id; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @return mixed |
119
|
|
|
*/ |
120
|
|
|
public function getTitle() |
121
|
|
|
{ |
122
|
|
|
return $this->title; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* @param mixed $title |
127
|
|
|
*/ |
128
|
|
|
public function setTitle($title) |
129
|
|
|
{ |
130
|
|
|
$this->title = $title; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* @return mixed |
135
|
|
|
*/ |
136
|
|
|
public function getDescription() |
137
|
|
|
{ |
138
|
|
|
return $this->description; |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* @param mixed $description |
143
|
|
|
*/ |
144
|
|
|
public function setDescription($description) |
145
|
|
|
{ |
146
|
|
|
$this->description = $description; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* @return mixed |
151
|
|
|
*/ |
152
|
|
|
public function getProviderName() |
153
|
|
|
{ |
154
|
|
|
return $this->providerName; |
155
|
|
|
} |
156
|
|
|
|
157
|
|
|
/** |
158
|
|
|
* @param mixed $providerName |
159
|
|
|
* @return Media |
160
|
|
|
*/ |
161
|
|
|
public function setProviderName($providerName) |
162
|
|
|
{ |
163
|
|
|
$this->providerName = $providerName; |
164
|
|
|
|
165
|
|
|
return $this; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* @return mixed |
170
|
|
|
*/ |
171
|
|
|
public function getProviderReference() |
172
|
|
|
{ |
173
|
|
|
return $this->providerReference; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* @param mixed $providerReference |
178
|
|
|
*/ |
179
|
|
|
public function setProviderReference($providerReference) |
180
|
|
|
{ |
181
|
|
|
$this->providerReference = $providerReference; |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* @return array |
186
|
|
|
*/ |
187
|
|
|
public function getProviderMetaData() |
188
|
|
|
{ |
189
|
|
|
return $this->providerMetaData; |
190
|
|
|
} |
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* @param array $providerMetaData |
194
|
|
|
*/ |
195
|
|
|
public function setProviderMetaData(array $providerMetaData) |
196
|
|
|
{ |
197
|
|
|
$this->providerMetaData = $providerMetaData; |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* @return mixed |
202
|
|
|
*/ |
203
|
|
|
public function getImage() |
204
|
|
|
{ |
205
|
|
|
return $this->image; |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* @param mixed $image |
210
|
|
|
* @return Media |
211
|
|
|
*/ |
212
|
|
|
public function setImage($image) |
213
|
|
|
{ |
214
|
|
|
$this->image = $image; |
215
|
|
|
|
216
|
|
|
return $this; |
217
|
|
|
} |
218
|
|
|
|
219
|
|
|
/** |
220
|
|
|
* @return array |
221
|
|
|
*/ |
222
|
|
|
public function getImageMetaData() |
223
|
|
|
{ |
224
|
|
|
return $this->imageMetaData; |
225
|
|
|
} |
226
|
|
|
|
227
|
|
|
/** |
228
|
|
|
* @param array $imageMetaData |
229
|
|
|
* @return Media |
230
|
|
|
*/ |
231
|
|
|
public function setImageMetaData(array $imageMetaData) |
232
|
|
|
{ |
233
|
|
|
$this->imageMetaData = $imageMetaData; |
234
|
|
|
|
235
|
|
|
return $this; |
236
|
|
|
} |
237
|
|
|
|
238
|
|
|
/** |
239
|
|
|
* @return mixed |
240
|
|
|
*/ |
241
|
|
|
public function getPointOfInterest() |
242
|
|
|
{ |
243
|
|
|
return $this->pointOfInterest; |
244
|
|
|
} |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* @param mixed $pointOfInterest |
248
|
|
|
* @return Media |
249
|
|
|
*/ |
250
|
|
|
public function setPointOfInterest($pointOfInterest) |
251
|
|
|
{ |
252
|
|
|
$this->pointOfInterest = $pointOfInterest; |
253
|
|
|
|
254
|
|
|
return $this; |
255
|
|
|
} |
256
|
|
|
|
257
|
|
|
/** |
258
|
|
|
* @return mixed |
259
|
|
|
*/ |
260
|
|
|
public function getCopyright() |
261
|
|
|
{ |
262
|
|
|
return $this->copyright; |
263
|
|
|
} |
264
|
|
|
|
265
|
|
|
/** |
266
|
|
|
* @param mixed $copyright |
267
|
|
|
*/ |
268
|
|
|
public function setCopyright($copyright) |
269
|
|
|
{ |
270
|
|
|
$this->copyright = $copyright; |
271
|
|
|
} |
272
|
|
|
|
273
|
|
|
/** |
274
|
|
|
* @return mixed |
275
|
|
|
*/ |
276
|
|
|
public function getAuthorName() |
277
|
|
|
{ |
278
|
|
|
return $this->authorName; |
279
|
|
|
} |
280
|
|
|
|
281
|
|
|
/** |
282
|
|
|
* @param mixed $authorName |
283
|
|
|
* @return Media |
284
|
|
|
*/ |
285
|
|
|
public function setAuthorName($authorName) |
286
|
|
|
{ |
287
|
|
|
$this->authorName = $authorName; |
288
|
|
|
|
289
|
|
|
return $this; |
290
|
|
|
} |
291
|
|
|
|
292
|
|
|
/** |
293
|
|
|
* @return string |
294
|
|
|
*/ |
295
|
|
|
public function getBinaryContent() |
296
|
|
|
{ |
297
|
|
|
return $this->binaryContent; |
298
|
|
|
} |
299
|
|
|
|
300
|
|
|
/** |
301
|
|
|
* @param string $binaryContent |
302
|
|
|
* @return Media |
303
|
|
|
*/ |
304
|
|
|
public function setBinaryContent($binaryContent) |
305
|
|
|
{ |
306
|
|
|
$this->binaryContent = $binaryContent; |
307
|
|
|
|
308
|
|
|
return $this; |
309
|
|
|
} |
310
|
|
|
|
311
|
|
|
/** |
312
|
|
|
* @return mixed |
313
|
|
|
*/ |
314
|
|
|
public function getSlug() |
315
|
|
|
{ |
316
|
|
|
return $this->getId(); |
317
|
|
|
} |
318
|
|
|
|
319
|
|
|
/** |
320
|
|
|
* @return mixed |
321
|
|
|
*/ |
322
|
|
|
public function getCreatedAt() |
323
|
|
|
{ |
324
|
|
|
return $this->createdAt; |
325
|
|
|
} |
326
|
|
|
|
327
|
|
|
/** |
328
|
|
|
* @param mixed $createdAt |
329
|
|
|
* @return Media |
330
|
|
|
*/ |
331
|
|
|
public function setCreatedAt($createdAt) |
332
|
|
|
{ |
333
|
|
|
$this->createdAt = $createdAt; |
334
|
|
|
|
335
|
|
|
return $this; |
336
|
|
|
} |
337
|
|
|
|
338
|
|
|
/** |
339
|
|
|
* @return \DateTime |
340
|
|
|
*/ |
341
|
|
|
public function getUpdatedAt() |
342
|
|
|
{ |
343
|
|
|
return $this->updatedAt; |
344
|
|
|
} |
345
|
|
|
|
346
|
|
|
/** |
347
|
|
|
* @param \DateTime $updatedAt |
348
|
|
|
* @return Media |
349
|
|
|
*/ |
350
|
|
|
public function setUpdatedAt($updatedAt) |
351
|
|
|
{ |
352
|
|
|
$this->updatedAt = $updatedAt; |
353
|
|
|
|
354
|
|
|
return $this; |
355
|
|
|
} |
356
|
|
|
|
357
|
|
|
/** |
358
|
|
|
* @return string |
359
|
|
|
*/ |
360
|
|
|
public function getImageContent() |
361
|
|
|
{ |
362
|
|
|
return $this->imageContent; |
363
|
|
|
} |
364
|
|
|
|
365
|
|
|
/** |
366
|
|
|
* @param string $imageContent |
367
|
|
|
* @return Media |
368
|
|
|
*/ |
369
|
|
|
public function setImageContent($imageContent) |
370
|
|
|
{ |
371
|
|
|
$this->imageContent = $imageContent; |
372
|
|
|
|
373
|
|
|
return $this; |
374
|
|
|
} |
375
|
|
|
} |
376
|
|
|
|