1 | <?php |
||
30 | * @Gedmo\TranslationEntity(class="App\Entity\Translations\PerformanceTranslation") |
||
31 | * @ExclusionPolicy("all") |
||
32 | * @MinSizeSliderImage() |
||
33 | * @ProducerConstraint() |
||
34 | */ |
||
35 | class Performance extends AbstractPersonalTranslatable implements TranslatableInterface |
||
36 | { |
||
37 | use TimestampableTrait, LinksTrait, BlameableEntity, DeletedByTrait; |
||
38 | |||
39 | /** |
||
40 | * @var integer |
||
41 | * |
||
42 | * @ORM\Column(name="id", type="integer") |
||
43 | * @ORM\Id |
||
44 | * @ORM\GeneratedValue(strategy="AUTO") |
||
45 | */ |
||
46 | private $id; |
||
47 | |||
48 | /** |
||
49 | * @var string |
||
50 | * @Gedmo\Translatable |
||
51 | * @Assert\NotBlank() |
||
52 | * @ORM\Column(type="string", length=255) |
||
53 | * @Type("string") |
||
54 | * @Expose |
||
55 | * @Groups({"Default", "poster"}) |
||
56 | */ |
||
57 | private $title; |
||
58 | |||
59 | /** |
||
60 | * @var string |
||
61 | * @Gedmo\Translatable |
||
62 | * @ORM\Column(type="text", length=255, nullable=true) |
||
63 | * @Type("string") |
||
64 | * @Expose |
||
65 | */ |
||
66 | private $type; |
||
67 | |||
68 | /** |
||
69 | * @var string |
||
70 | * @Gedmo\Translatable |
||
71 | * @Assert\NotBlank() |
||
72 | * @ORM\Column(type="text", nullable=true) |
||
73 | * @Type("string") |
||
74 | * @Expose |
||
75 | */ |
||
76 | private $description; |
||
77 | |||
78 | /** |
||
79 | * @var /Datetime |
||
80 | * |
||
81 | * @Assert\NotBlank() |
||
82 | * @ORM\Column(type="datetime") |
||
83 | * @Type("DateTime") |
||
84 | * @Expose |
||
85 | */ |
||
86 | private $premiere; |
||
87 | |||
88 | /** |
||
89 | * @var |
||
90 | * |
||
91 | * @ORM\OneToOne(targetEntity="App\Entity\Media", cascade={"persist"}) |
||
92 | * @ORM\JoinColumn(name="mainPicture_id", referencedColumnName="id", nullable=true) |
||
93 | * @Assert\Valid() |
||
94 | * @Groups({"Default", "poster"}) |
||
95 | */ |
||
96 | private $mainPicture; |
||
97 | |||
98 | /** |
||
99 | * @var |
||
100 | * |
||
101 | * @ORM\OneToOne(targetEntity="App\Entity\Media", cascade={"persist"}) |
||
102 | * @ORM\JoinColumn(name="sliderImage_id", referencedColumnName="id", nullable=true) |
||
103 | * @Groups({"Default", "poster"}) |
||
104 | */ |
||
105 | private $sliderImage; |
||
106 | |||
107 | /** |
||
108 | * @var array |
||
109 | * @Expose |
||
110 | * @Type("array") |
||
111 | * @SerializedName("mainPicture") |
||
112 | * @Groups({"Default", "poster"}) |
||
113 | */ |
||
114 | public $mainPictureThumbnails; |
||
115 | |||
116 | /** |
||
117 | * @var array |
||
118 | * @Expose |
||
119 | * @Type("array") |
||
120 | * @SerializedName("sliderImage") |
||
121 | * @Groups({"Default", "poster"}) |
||
122 | */ |
||
123 | public $sliderImageThumbnails; |
||
124 | |||
125 | /** |
||
126 | * @var PerformanceEvent[] |
||
127 | * |
||
128 | * @ORM\OneToMany(targetEntity="App\Entity\PerformanceEvent", mappedBy="performance", cascade={"persist"}, orphanRemoval=true) |
||
129 | */ |
||
130 | private $performanceEvents; |
||
131 | |||
132 | /** |
||
133 | * @var Role[] |
||
134 | * |
||
135 | * @ORM\OneToMany(targetEntity="App\Entity\Role", mappedBy="performance", cascade={"persist", "remove"}, orphanRemoval=true) |
||
136 | * @Assert\Valid() |
||
137 | */ |
||
138 | private $roles; |
||
139 | |||
140 | /** |
||
141 | * @var \App\Entity\GalleryHasMedia |
||
142 | * |
||
143 | * @ORM\ManyToMany(targetEntity="App\Entity\GalleryHasMedia", cascade={"persist"}, fetch="EAGER") |
||
144 | * @ORM\JoinTable(name="performance_galleryHasMedia", |
||
145 | * joinColumns={@ORM\JoinColumn(name="performance_id",referencedColumnName="id")}, |
||
146 | * inverseJoinColumns={@ORM\JoinColumn(name="galleryHasMedia_id",referencedColumnName="id")} |
||
147 | * ) |
||
148 | */ |
||
149 | private $galleryHasMedia; |
||
150 | |||
151 | /** |
||
152 | * @var array |
||
153 | * @Expose |
||
154 | * @Type("array") |
||
155 | * @SerializedName("gallery") |
||
156 | */ |
||
157 | public $galleryHasMediaThumbnails; |
||
158 | |||
159 | /** |
||
160 | * @Gedmo\Slug(fields={"title"}) |
||
161 | * @ORM\Column(name="slug", type="string", length=255) |
||
162 | * @Type("string") |
||
163 | * @Expose |
||
164 | * @Groups({"Default", "poster"}) |
||
165 | */ |
||
166 | private $slug; |
||
167 | |||
168 | /** |
||
169 | * @var ArrayCollection |
||
170 | * |
||
171 | * @ORM\OneToMany( |
||
172 | * targetEntity="App\Entity\Translations\PerformanceTranslation", |
||
173 | * mappedBy="object", |
||
174 | * cascade={"persist", "remove"} |
||
175 | * ) |
||
176 | */ |
||
177 | protected $translations; |
||
178 | |||
179 | /** |
||
180 | * @var \App\Entity\History |
||
181 | 16 | * |
|
182 | * @ORM\ManyToOne(targetEntity="App\Entity\History", inversedBy="performances") |
||
183 | 16 | * @Assert\Valid() |
|
184 | 16 | */ |
|
185 | 16 | protected $festival; |
|
186 | 16 | ||
187 | 16 | /** |
|
188 | 16 | * @ORM\ManyToMany(targetEntity="App\Entity\RepertoireSeason", inversedBy="performances") |
|
189 | * @Expose |
||
190 | * @Serializer\MaxDepth(1) |
||
191 | * @Assert\Valid() |
||
192 | */ |
||
193 | private $seasons; |
||
194 | |||
195 | 7 | /** |
|
196 | * @ORM\Column(type="AudienceEnum", options={"default":"adults"}) |
||
197 | 7 | * @DoctrineAssert\Enum(entity="App\Enum\AudienceEnum") |
|
198 | * @Type("string") |
||
199 | 7 | * @Expose |
|
200 | * @Assert\Valid() |
||
201 | */ |
||
202 | private string $audience; |
||
|
|||
203 | |||
204 | /** |
||
205 | * @ORM\Column(type="integer", nullable=false, options={"default":0}) |
||
206 | * @Assert\PositiveOrZero |
||
207 | 3 | * @Type("integer") |
|
208 | * @Groups({"Default", "poster"}) |
||
209 | 3 | * @Expose |
|
210 | */ |
||
211 | private int $ageLimit; |
||
212 | |||
213 | /** |
||
214 | * @ORM\Column(type="integer", nullable=false) |
||
215 | * @Assert\PositiveOrZero |
||
216 | * @Type("integer") |
||
217 | 3 | * @Groups({"Default", "poster"}) |
|
218 | * @Expose |
||
219 | 3 | */ |
|
220 | private int $durationInMin; |
||
221 | |||
222 | /** |
||
223 | * @ORM\ManyToOne(targetEntity="App\Entity\Employee", inversedBy="produce") |
||
224 | * @ORM\JoinColumn(name="producer_id", referencedColumnName="id", onDelete="SET NULL") |
||
225 | * @Expose |
||
226 | */ |
||
227 | private ?Employee $producer; |
||
228 | |||
229 | /** |
||
230 | * @ORM\Column(type="string", length=255, nullable=true) |
||
231 | * @Expose |
||
232 | */ |
||
233 | private ?string $extProducer; |
||
234 | |||
235 | /** |
||
236 | * Constructor |
||
237 | */ |
||
238 | public function __construct() |
||
239 | { |
||
240 | 1 | parent::__construct(); |
|
241 | $this->performanceEvents = new ArrayCollection(); |
||
242 | 1 | $this->roles = new ArrayCollection(); |
|
243 | $this->galleryHasMedia = new ArrayCollection(); |
||
244 | $this->seasons = new ArrayCollection(); |
||
245 | } |
||
246 | |||
247 | /** |
||
248 | * Unset translations |
||
249 | * |
||
250 | * @return Performance |
||
251 | */ |
||
252 | public function unsetTranslations() |
||
253 | { |
||
254 | $this->translations = null; |
||
255 | |||
256 | return $this; |
||
257 | } |
||
258 | |||
259 | /** |
||
260 | * Get id |
||
261 | * |
||
262 | * @return integer |
||
263 | 3 | */ |
|
264 | public function getId() |
||
265 | 3 | { |
|
266 | return $this->id; |
||
267 | } |
||
268 | |||
269 | /** |
||
270 | * Get type |
||
271 | * |
||
272 | * @return string |
||
273 | */ |
||
274 | public function getType() |
||
275 | { |
||
276 | return $this->type; |
||
277 | } |
||
278 | |||
279 | /** |
||
280 | * Set type |
||
281 | * |
||
282 | * @param string $type |
||
283 | * @return Performance |
||
284 | */ |
||
285 | public function setType($type) |
||
286 | 11 | { |
|
287 | $this->type = $type; |
||
288 | 11 | ||
289 | return $this; |
||
290 | } |
||
291 | |||
292 | /** |
||
293 | * Get description |
||
294 | * |
||
295 | * @return string |
||
296 | */ |
||
297 | public function getDescription() |
||
298 | { |
||
299 | return $this->description; |
||
300 | } |
||
301 | |||
302 | /** |
||
303 | * Set description |
||
304 | * |
||
305 | * @param string $description |
||
306 | * @return Performance |
||
307 | */ |
||
308 | public function setDescription($description) |
||
309 | 24 | { |
|
310 | $this->description = $description; |
||
311 | 24 | ||
312 | return $this; |
||
313 | } |
||
314 | |||
315 | /** |
||
316 | * Get premiere |
||
317 | * |
||
318 | * @return \DateTime |
||
319 | */ |
||
320 | 14 | public function getPremiere() |
|
321 | { |
||
322 | 14 | return $this->premiere; |
|
323 | } |
||
324 | 14 | ||
325 | /** |
||
326 | * Set premiere |
||
327 | * |
||
328 | * @param \DateTime $premiere |
||
329 | * @return Performance |
||
330 | */ |
||
331 | public function setPremiere($premiere) |
||
332 | 5 | { |
|
333 | $this->premiere = $premiere; |
||
334 | 5 | ||
335 | return $this; |
||
336 | } |
||
337 | |||
338 | /** |
||
339 | * Get mainPicture |
||
340 | * |
||
341 | * @return \App\Entity\Media |
||
342 | */ |
||
343 | public function getMainPicture() |
||
344 | { |
||
345 | return $this->mainPicture; |
||
346 | } |
||
347 | |||
348 | /** |
||
349 | * Set mainPicture |
||
350 | * |
||
351 | * @param \App\Entity\Media $mainPicture |
||
352 | * @return Performance |
||
353 | */ |
||
354 | public function setMainPicture(\App\Entity\Media $mainPicture = null) |
||
355 | { |
||
356 | $this->mainPicture = $mainPicture; |
||
357 | |||
358 | return $this; |
||
359 | } |
||
360 | |||
361 | /** |
||
362 | * Get sliderImage |
||
363 | * |
||
364 | * @return \App\Entity\Media |
||
365 | */ |
||
366 | public function getSliderImage() |
||
367 | { |
||
368 | return $this->sliderImage; |
||
369 | } |
||
370 | |||
371 | /** |
||
372 | * Set sliderImage |
||
373 | * |
||
374 | * @param \App\Entity\Media $sliderImage |
||
375 | * @return Performance |
||
376 | */ |
||
377 | public function setSliderImage(\App\Entity\Media $sliderImage = null) |
||
378 | 2 | { |
|
379 | $this->sliderImage = $sliderImage; |
||
380 | 2 | ||
381 | return $this; |
||
382 | } |
||
383 | |||
384 | /** |
||
385 | * Get slug |
||
386 | * |
||
387 | * @return string |
||
388 | */ |
||
389 | public function getSlug() |
||
390 | { |
||
391 | return $this->slug; |
||
392 | } |
||
393 | |||
394 | /** |
||
395 | * Set slug |
||
396 | * |
||
397 | * @param string $slug |
||
398 | * @return Performance |
||
399 | */ |
||
400 | public function setSlug($slug) |
||
401 | { |
||
402 | $this->slug = $slug; |
||
403 | |||
404 | return $this; |
||
405 | } |
||
406 | |||
407 | /** |
||
408 | * Add performanceEvent |
||
409 | * |
||
410 | * @param \App\Entity\PerformanceEvent $performanceEvent |
||
411 | * @return Performance |
||
412 | 4 | */ |
|
413 | public function addPerformanceEvent(\App\Entity\PerformanceEvent $performanceEvent) |
||
414 | 4 | { |
|
415 | $this->performanceEvents[] = $performanceEvent; |
||
416 | |||
417 | 6 | return $this; |
|
418 | } |
||
419 | 6 | ||
420 | /** |
||
421 | * Remove performanceEvent |
||
422 | * |
||
423 | * @param \App\Entity\PerformanceEvent $performanceEvent |
||
424 | */ |
||
425 | public function removePerformanceEvent(\App\Entity\PerformanceEvent $performanceEvent) |
||
426 | { |
||
427 | 8 | $this->performanceEvents->removeElement($performanceEvent); |
|
428 | } |
||
429 | 8 | ||
430 | /** |
||
431 | * Get performanceEvents |
||
432 | * |
||
433 | * @return \Doctrine\Common\Collections\Collection |
||
434 | */ |
||
435 | public function getPerformanceEvents() |
||
436 | { |
||
437 | return $this->performanceEvents; |
||
438 | } |
||
439 | |||
440 | /** |
||
441 | * Add role |
||
442 | * |
||
443 | * @param \App\Entity\Role $role |
||
444 | * @return Performance |
||
445 | */ |
||
446 | public function addRole(\App\Entity\Role $role) |
||
447 | { |
||
448 | $role->setPerformance($this); |
||
449 | $this->roles[] = $role; |
||
450 | |||
451 | return $this; |
||
452 | } |
||
453 | |||
454 | /** |
||
455 | * Remove role |
||
456 | * |
||
457 | * @param \App\Entity\Role $role |
||
458 | */ |
||
459 | public function removeRole(\App\Entity\Role $role) |
||
460 | { |
||
461 | $this->roles->removeElement($role); |
||
462 | } |
||
463 | |||
464 | /** |
||
465 | * Get roles |
||
466 | * |
||
467 | * @return Role[]|\Doctrine\Common\Collections\Collection |
||
468 | */ |
||
469 | public function getRoles() |
||
470 | { |
||
471 | return $this->roles; |
||
472 | } |
||
473 | 9 | ||
474 | public function __toString() |
||
475 | 9 | { |
|
476 | return $this->getTitle() ?: ''; |
||
477 | } |
||
478 | |||
479 | /** |
||
480 | * Get title |
||
481 | 3 | * |
|
482 | * @return string |
||
483 | 3 | */ |
|
484 | public function getTitle() |
||
485 | { |
||
486 | return $this->title; |
||
487 | } |
||
488 | |||
489 | /** |
||
490 | * Set title |
||
491 | * |
||
492 | * @param string $title |
||
493 | * @return Performance |
||
494 | */ |
||
495 | public function setTitle($title) |
||
496 | { |
||
497 | $this->title = $title; |
||
498 | |||
499 | return $this; |
||
500 | 5 | } |
|
501 | |||
502 | 5 | /** |
|
503 | * Add galleryHasMedia |
||
504 | * |
||
505 | 1 | * @param \App\Entity\GalleryHasMedia $galleryHasMedia |
|
506 | * @return Performance |
||
507 | 1 | */ |
|
508 | 1 | public function addGalleryHasMedion(\App\Entity\GalleryHasMedia $galleryHasMedia) |
|
509 | { |
||
510 | $this->galleryHasMedia[] = $galleryHasMedia; |
||
511 | 1 | ||
512 | return $this; |
||
513 | } |
||
514 | |||
515 | public function addGalleryHasMedia(\App\Entity\GalleryHasMedia $galleryHasMedia) |
||
516 | { |
||
517 | return $this->addGalleryHasMedion($galleryHasMedia); |
||
518 | } |
||
519 | |||
520 | /** |
||
521 | * Remove galleryHasMedia |
||
522 | * |
||
523 | * @param \App\Entity\GalleryHasMedia $galleryHasMedia |
||
641 |