1
|
|
|
<?php |
2
|
|
|
namespace DERHANSEN\SfEventMgt\Domain\Model; |
3
|
|
|
|
4
|
|
|
/* |
5
|
|
|
* This file is part of the TYPO3 CMS project. |
6
|
|
|
* |
7
|
|
|
* It is free software; you can redistribute it and/or modify it under |
8
|
|
|
* the terms of the GNU General Public License, either version 2 |
9
|
|
|
* of the License, or any later version. |
10
|
|
|
* |
11
|
|
|
* For the full copyright and license information, please read the |
12
|
|
|
* LICENSE.txt file that was distributed with this source code. |
13
|
|
|
* |
14
|
|
|
* The TYPO3 project - inspiring people to share! |
15
|
|
|
*/ |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Event |
19
|
|
|
* |
20
|
|
|
* @author Torben Hansen <[email protected]> |
21
|
|
|
*/ |
22
|
|
|
class Event extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity |
23
|
|
|
{ |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Title |
27
|
|
|
* |
28
|
|
|
* @var string |
29
|
|
|
* @validate NotEmpty |
30
|
|
|
*/ |
31
|
|
|
protected $title = ''; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Teaser |
35
|
|
|
* |
36
|
|
|
* @var string |
37
|
|
|
*/ |
38
|
|
|
protected $teaser = ''; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Description |
42
|
|
|
* |
43
|
|
|
* @var string |
44
|
|
|
*/ |
45
|
|
|
protected $description = ''; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Program/Schedule |
49
|
|
|
* |
50
|
|
|
* @var string |
51
|
|
|
*/ |
52
|
|
|
protected $program = ''; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Startdate and time |
56
|
|
|
* |
57
|
|
|
* @var \DateTime |
58
|
|
|
*/ |
59
|
|
|
protected $startdate = null; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Enddate and time |
63
|
|
|
* |
64
|
|
|
* @var \DateTime |
65
|
|
|
*/ |
66
|
|
|
protected $enddate = null; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Max participants |
70
|
|
|
* |
71
|
|
|
* @var int |
72
|
|
|
*/ |
73
|
|
|
protected $maxParticipants = 0; |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* Max registrations per user |
77
|
|
|
* |
78
|
|
|
* @var int |
79
|
|
|
*/ |
80
|
|
|
protected $maxRegistrationsPerUser = 1; |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* Price |
84
|
|
|
* |
85
|
|
|
* @var float |
86
|
|
|
*/ |
87
|
|
|
protected $price = 0.0; |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* Currency |
91
|
|
|
* |
92
|
|
|
* @var string |
93
|
|
|
*/ |
94
|
|
|
protected $currency = ''; |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* Enable payment |
98
|
|
|
* |
99
|
|
|
* @var bool |
100
|
|
|
*/ |
101
|
|
|
protected $enablePayment = false; |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* Restrict payment methods |
105
|
|
|
* |
106
|
|
|
* @var bool |
107
|
|
|
*/ |
108
|
|
|
protected $restrictPaymentMethods = false; |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* Selected payment methods |
112
|
|
|
* |
113
|
|
|
* @var string |
114
|
|
|
*/ |
115
|
|
|
protected $selectedPaymentMethods = ''; |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* Category |
119
|
|
|
* |
120
|
|
|
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category> |
121
|
|
|
*/ |
122
|
|
|
protected $category = null; |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* Registration |
126
|
|
|
* |
127
|
|
|
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\DERHANSEN\SfEventMgt\Domain\Model\Registration> |
128
|
|
|
* @cascade remove |
129
|
|
|
*/ |
130
|
|
|
protected $registration = null; |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* Registration deadline date |
134
|
|
|
* |
135
|
|
|
* @var \DateTime |
136
|
|
|
*/ |
137
|
|
|
protected $registrationDeadline = null; |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* The image |
141
|
|
|
* |
142
|
|
|
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> |
143
|
|
|
*/ |
144
|
|
|
protected $image = null; |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* Additional files |
148
|
|
|
* |
149
|
|
|
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> |
150
|
|
|
*/ |
151
|
|
|
protected $files = null; |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* YouTube Embed code |
155
|
|
|
* |
156
|
|
|
* @var string |
157
|
|
|
*/ |
158
|
|
|
protected $youtube = ''; |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* The Location |
162
|
|
|
* |
163
|
|
|
* @var \DERHANSEN\SfEventMgt\Domain\Model\Location |
164
|
|
|
*/ |
165
|
|
|
protected $location = null; |
166
|
|
|
|
167
|
|
|
/** |
168
|
|
|
* Enable registration |
169
|
|
|
* |
170
|
|
|
* @var bool |
171
|
|
|
*/ |
172
|
|
|
protected $enableRegistration = false; |
173
|
|
|
|
174
|
|
|
/** |
175
|
|
|
* Link |
176
|
|
|
* |
177
|
|
|
* @var string |
178
|
|
|
*/ |
179
|
|
|
protected $link; |
180
|
|
|
|
181
|
|
|
/** |
182
|
|
|
* Top event |
183
|
|
|
* |
184
|
|
|
* @var bool |
185
|
|
|
*/ |
186
|
|
|
protected $topEvent = false; |
187
|
|
|
|
188
|
|
|
/** |
189
|
|
|
* The additionalImage |
190
|
|
|
* |
191
|
|
|
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> |
192
|
|
|
*/ |
193
|
|
|
protected $additionalImage = null; |
194
|
|
|
|
195
|
|
|
/** |
196
|
|
|
* The organisator |
197
|
|
|
* |
198
|
|
|
* @var \DERHANSEN\SfEventMgt\Domain\Model\Organisator |
199
|
|
|
*/ |
200
|
|
|
protected $organisator = null; |
201
|
|
|
|
202
|
|
|
/** |
203
|
|
|
* Notify admin |
204
|
|
|
* |
205
|
|
|
* @var bool |
206
|
|
|
*/ |
207
|
|
|
protected $notifyAdmin = true; |
208
|
|
|
|
209
|
|
|
/** |
210
|
|
|
* Notify organisator |
211
|
|
|
* |
212
|
|
|
* @var bool |
213
|
|
|
*/ |
214
|
|
|
protected $notifyOrganisator = false; |
215
|
|
|
|
216
|
|
|
/** |
217
|
|
|
* Enable cancel of registration |
218
|
|
|
* |
219
|
|
|
* @var bool |
220
|
|
|
*/ |
221
|
|
|
protected $enableCancel = false; |
222
|
|
|
|
223
|
|
|
/** |
224
|
|
|
* Deadline for cancel |
225
|
|
|
* |
226
|
|
|
* @var \DateTime |
227
|
|
|
*/ |
228
|
|
|
protected $cancelDeadline = null; |
229
|
|
|
|
230
|
|
|
/** |
231
|
|
|
* Unique e-mail check |
232
|
|
|
* |
233
|
|
|
* @var bool |
234
|
|
|
*/ |
235
|
|
|
protected $uniqueEmailCheck = false; |
236
|
|
|
|
237
|
|
|
/** |
238
|
|
|
* __construct |
239
|
|
|
*/ |
240
|
|
|
public function __construct() |
241
|
|
|
{ |
242
|
|
|
//Do not remove the next line: It would break the functionality |
243
|
|
|
$this->initStorageObjects(); |
244
|
|
|
} |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* Initializes all ObjectStorage properties |
248
|
|
|
* Do not modify this method! |
249
|
|
|
* It will be rewritten on each save in the extension builder |
250
|
|
|
* You may modify the constructor of this class instead |
251
|
|
|
* |
252
|
|
|
* @return void |
253
|
|
|
*/ |
254
|
|
|
protected function initStorageObjects() |
255
|
|
|
{ |
256
|
|
|
$this->category = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); |
257
|
|
|
$this->registration = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); |
258
|
|
|
$this->image = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); |
259
|
|
|
$this->files = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); |
260
|
|
|
$this->additionalImage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); |
261
|
|
|
} |
262
|
|
|
|
263
|
|
|
/** |
264
|
|
|
* Returns the title |
265
|
|
|
* |
266
|
|
|
* @return string $title |
267
|
|
|
*/ |
268
|
|
|
public function getTitle() |
269
|
|
|
{ |
270
|
|
|
return $this->title; |
271
|
|
|
} |
272
|
|
|
|
273
|
|
|
/** |
274
|
|
|
* Sets the title |
275
|
|
|
* |
276
|
|
|
* @param string $title Title |
277
|
|
|
* |
278
|
|
|
* @return void |
279
|
|
|
*/ |
280
|
|
|
public function setTitle($title) |
281
|
|
|
{ |
282
|
|
|
$this->title = $title; |
283
|
|
|
} |
284
|
|
|
|
285
|
|
|
/** |
286
|
|
|
* Returns the teaser |
287
|
|
|
* |
288
|
|
|
* @return string |
289
|
|
|
*/ |
290
|
|
|
public function getTeaser() |
291
|
|
|
{ |
292
|
|
|
return $this->teaser; |
293
|
|
|
} |
294
|
|
|
|
295
|
|
|
/** |
296
|
|
|
* Sets the teaser |
297
|
|
|
* |
298
|
|
|
* @param string $teaser Teaser |
299
|
|
|
* |
300
|
|
|
* @return void |
301
|
|
|
*/ |
302
|
|
|
public function setTeaser($teaser) |
303
|
|
|
{ |
304
|
|
|
$this->teaser = $teaser; |
305
|
|
|
} |
306
|
|
|
|
307
|
|
|
/** |
308
|
|
|
* Returns the description |
309
|
|
|
* |
310
|
|
|
* @return string $description |
311
|
|
|
*/ |
312
|
|
|
public function getDescription() |
313
|
|
|
{ |
314
|
|
|
return $this->description; |
315
|
|
|
} |
316
|
|
|
|
317
|
|
|
/** |
318
|
|
|
* Sets the description |
319
|
|
|
* |
320
|
|
|
* @param string $description Description |
321
|
|
|
* |
322
|
|
|
* @return void |
323
|
|
|
*/ |
324
|
|
|
public function setDescription($description) |
325
|
|
|
{ |
326
|
|
|
$this->description = $description; |
327
|
|
|
} |
328
|
|
|
|
329
|
|
|
/** |
330
|
|
|
* Returns the program |
331
|
|
|
* |
332
|
|
|
* @return string $program |
333
|
|
|
*/ |
334
|
|
|
public function getProgram() |
335
|
|
|
{ |
336
|
|
|
return $this->program; |
337
|
|
|
} |
338
|
|
|
|
339
|
|
|
/** |
340
|
|
|
* Sets the program |
341
|
|
|
* |
342
|
|
|
* @param string $program The program |
343
|
|
|
* |
344
|
|
|
* @return void |
345
|
|
|
*/ |
346
|
|
|
public function setProgram($program) |
347
|
|
|
{ |
348
|
|
|
$this->program = $program; |
349
|
|
|
} |
350
|
|
|
|
351
|
|
|
/** |
352
|
|
|
* Returns the startdate |
353
|
|
|
* |
354
|
|
|
* @return \DateTime $startdate |
355
|
|
|
*/ |
356
|
|
|
public function getStartdate() |
357
|
|
|
{ |
358
|
|
|
return $this->startdate; |
359
|
|
|
} |
360
|
|
|
|
361
|
|
|
/** |
362
|
|
|
* Sets the startdate |
363
|
|
|
* |
364
|
|
|
* @param \DateTime $startdate Startdate |
365
|
|
|
* |
366
|
|
|
* @return void |
367
|
|
|
*/ |
368
|
|
|
public function setStartdate(\DateTime $startdate) |
369
|
|
|
{ |
370
|
|
|
$this->startdate = $startdate; |
371
|
|
|
} |
372
|
|
|
|
373
|
|
|
/** |
374
|
|
|
* Returns the enddate |
375
|
|
|
* |
376
|
|
|
* @return \DateTime $enddate |
377
|
|
|
*/ |
378
|
|
|
public function getEnddate() |
379
|
|
|
{ |
380
|
|
|
return $this->enddate; |
381
|
|
|
} |
382
|
|
|
|
383
|
|
|
/** |
384
|
|
|
* Sets the enddate |
385
|
|
|
* |
386
|
|
|
* @param \DateTime $enddate Enddate |
387
|
|
|
* |
388
|
|
|
* @return void |
389
|
|
|
*/ |
390
|
|
|
public function setEnddate(\DateTime $enddate) |
391
|
|
|
{ |
392
|
|
|
$this->enddate = $enddate; |
393
|
|
|
} |
394
|
|
|
|
395
|
|
|
/** |
396
|
|
|
* Returns the participants |
397
|
|
|
* |
398
|
|
|
* @return int $participants |
399
|
|
|
*/ |
400
|
|
|
public function getMaxParticipants() |
401
|
|
|
{ |
402
|
|
|
return $this->maxParticipants; |
403
|
|
|
} |
404
|
|
|
|
405
|
|
|
/** |
406
|
|
|
* Sets the participants |
407
|
|
|
* |
408
|
|
|
* @param int $participants Participants |
409
|
|
|
* |
410
|
|
|
* @return void |
411
|
|
|
*/ |
412
|
|
|
public function setMaxParticipants($participants) |
413
|
|
|
{ |
414
|
|
|
$this->maxParticipants = $participants; |
415
|
|
|
} |
416
|
|
|
|
417
|
|
|
/** |
418
|
|
|
* Returns the price |
419
|
|
|
* |
420
|
|
|
* @return float $price |
421
|
|
|
*/ |
422
|
|
|
public function getPrice() |
423
|
|
|
{ |
424
|
|
|
return $this->price; |
425
|
|
|
} |
426
|
|
|
|
427
|
|
|
/** |
428
|
|
|
* Sets the price |
429
|
|
|
* |
430
|
|
|
* @param float $price Price |
431
|
|
|
* |
432
|
|
|
* @return void |
433
|
|
|
*/ |
434
|
|
|
public function setPrice($price) |
435
|
|
|
{ |
436
|
|
|
$this->price = $price; |
437
|
|
|
} |
438
|
|
|
|
439
|
|
|
/** |
440
|
|
|
* Returns the currency |
441
|
|
|
* |
442
|
|
|
* @return string $currency |
443
|
|
|
*/ |
444
|
|
|
public function getCurrency() |
445
|
|
|
{ |
446
|
|
|
return $this->currency; |
447
|
|
|
} |
448
|
|
|
|
449
|
|
|
/** |
450
|
|
|
* Sets the currency |
451
|
|
|
* |
452
|
|
|
* @param string $currency Currency |
453
|
|
|
* |
454
|
|
|
* @return void |
455
|
|
|
*/ |
456
|
|
|
public function setCurrency($currency) |
457
|
|
|
{ |
458
|
|
|
$this->currency = $currency; |
459
|
|
|
} |
460
|
|
|
|
461
|
|
|
/** |
462
|
|
|
* Returns if payment is enabled |
463
|
|
|
* |
464
|
|
|
* @return boolean |
465
|
|
|
*/ |
466
|
|
|
public function getEnablePayment() |
467
|
|
|
{ |
468
|
|
|
return $this->enablePayment; |
469
|
|
|
} |
470
|
|
|
|
471
|
|
|
/** |
472
|
|
|
* Sets enablePayment |
473
|
|
|
* |
474
|
|
|
* @param boolean $enablePayment |
475
|
|
|
* @return void |
476
|
|
|
*/ |
477
|
|
|
public function setEnablePayment($enablePayment) |
478
|
|
|
{ |
479
|
|
|
$this->enablePayment = $enablePayment; |
480
|
|
|
} |
481
|
|
|
|
482
|
|
|
/** |
483
|
|
|
* Returns if payment methods should be restricted |
484
|
|
|
* |
485
|
|
|
* @return boolean |
486
|
|
|
*/ |
487
|
|
|
public function getRestrictPaymentMethods() |
488
|
|
|
{ |
489
|
|
|
return $this->restrictPaymentMethods; |
490
|
|
|
} |
491
|
|
|
|
492
|
|
|
/** |
493
|
|
|
* Sets if payment methods should be restricted |
494
|
|
|
* |
495
|
|
|
* @param boolean $restrictPaymentMethods |
496
|
|
|
* @return void |
497
|
|
|
*/ |
498
|
|
|
public function setRestrictPaymentMethods($restrictPaymentMethods) |
499
|
|
|
{ |
500
|
|
|
$this->restrictPaymentMethods = $restrictPaymentMethods; |
501
|
|
|
} |
502
|
|
|
|
503
|
|
|
/** |
504
|
|
|
* Returns selected payment methods |
505
|
|
|
* |
506
|
|
|
* @return string |
507
|
|
|
*/ |
508
|
|
|
public function getSelectedPaymentMethods() |
509
|
|
|
{ |
510
|
|
|
return $this->selectedPaymentMethods; |
511
|
|
|
} |
512
|
|
|
|
513
|
|
|
/** |
514
|
|
|
* Sets selected payment methods |
515
|
|
|
* |
516
|
|
|
* @param string $selectedPaymentMethods |
517
|
|
|
* @return void |
518
|
|
|
*/ |
519
|
|
|
public function setSelectedPaymentMethods($selectedPaymentMethods) |
520
|
|
|
{ |
521
|
|
|
$this->selectedPaymentMethods = $selectedPaymentMethods; |
522
|
|
|
} |
523
|
|
|
|
524
|
|
|
/** |
525
|
|
|
* Adds a Category |
526
|
|
|
* |
527
|
|
|
* @param \TYPO3\CMS\Extbase\Domain\Model\Category $category Category |
528
|
|
|
* |
529
|
|
|
* @return void |
530
|
|
|
*/ |
531
|
|
|
public function addCategory(\TYPO3\CMS\Extbase\Domain\Model\Category $category) |
532
|
|
|
{ |
533
|
|
|
$this->category->attach($category); |
534
|
|
|
} |
535
|
|
|
|
536
|
|
|
/** |
537
|
|
|
* Removes a Category |
538
|
|
|
* |
539
|
|
|
* @param \TYPO3\CMS\Extbase\Domain\Model\Category $categoryToRemove The Category to be removed |
540
|
|
|
* |
541
|
|
|
* @return void |
542
|
|
|
*/ |
543
|
|
|
public function removeCategory(\TYPO3\CMS\Extbase\Domain\Model\Category $categoryToRemove) |
544
|
|
|
{ |
545
|
|
|
$this->category->detach($categoryToRemove); |
546
|
|
|
} |
547
|
|
|
|
548
|
|
|
/** |
549
|
|
|
* Returns the category |
550
|
|
|
* |
551
|
|
|
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage |
552
|
|
|
*/ |
553
|
|
|
public function getCategory() |
554
|
|
|
{ |
555
|
|
|
return $this->category; |
556
|
|
|
} |
557
|
|
|
|
558
|
|
|
/** |
559
|
|
|
* Sets the category |
560
|
|
|
* |
561
|
|
|
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $category Category |
562
|
|
|
* |
563
|
|
|
* @return void |
564
|
|
|
*/ |
565
|
|
|
public function setCategory(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $category) |
566
|
|
|
{ |
567
|
|
|
$this->category = $category; |
568
|
|
|
} |
569
|
|
|
|
570
|
|
|
/** |
571
|
|
|
* Adds a Registration |
572
|
|
|
* |
573
|
|
|
* @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration Registration |
574
|
|
|
* |
575
|
|
|
* @return void |
576
|
|
|
*/ |
577
|
|
|
public function addRegistration(\DERHANSEN\SfEventMgt\Domain\Model\Registration $registration) |
578
|
|
|
{ |
579
|
|
|
$this->registration->attach($registration); |
580
|
|
|
} |
581
|
|
|
|
582
|
|
|
/** |
583
|
|
|
* Removes a Registration |
584
|
|
|
* |
585
|
|
|
* @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registrationToRemove Registration |
586
|
|
|
* |
587
|
|
|
* @return void |
588
|
|
|
*/ |
589
|
|
|
public function removeRegistration(\DERHANSEN\SfEventMgt\Domain\Model\Registration $registrationToRemove) |
590
|
|
|
{ |
591
|
|
|
$this->registration->detach($registrationToRemove); |
592
|
|
|
} |
593
|
|
|
|
594
|
|
|
/** |
595
|
|
|
* Returns the Registration |
596
|
|
|
* |
597
|
|
|
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $registration |
598
|
|
|
*/ |
599
|
|
|
public function getRegistration() |
600
|
|
|
{ |
601
|
|
|
return $this->registration; |
602
|
|
|
} |
603
|
|
|
|
604
|
|
|
/** |
605
|
|
|
* Sets the Registration |
606
|
|
|
* |
607
|
|
|
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $registration Registration |
608
|
|
|
* |
609
|
|
|
* @return void |
610
|
|
|
*/ |
611
|
|
|
public function setRegistration(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $registration) |
612
|
|
|
{ |
613
|
|
|
$this->registration = $registration; |
614
|
|
|
} |
615
|
|
|
|
616
|
|
|
/** |
617
|
|
|
* Adds an image |
618
|
|
|
* |
619
|
|
|
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $image Image |
620
|
|
|
* |
621
|
|
|
* @return void |
622
|
|
|
*/ |
623
|
|
|
public function addImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $image) |
624
|
|
|
{ |
625
|
|
|
$this->image->attach($image); |
626
|
|
|
} |
627
|
|
|
|
628
|
|
|
/** |
629
|
|
|
* Removes an image |
630
|
|
|
* |
631
|
|
|
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageToRemove Image |
632
|
|
|
* |
633
|
|
|
* @return void |
634
|
|
|
*/ |
635
|
|
|
public function removeImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageToRemove) |
636
|
|
|
{ |
637
|
|
|
$this->image->detach($imageToRemove); |
638
|
|
|
} |
639
|
|
|
|
640
|
|
|
/** |
641
|
|
|
* Returns the image |
642
|
|
|
* |
643
|
|
|
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $image |
644
|
|
|
*/ |
645
|
|
|
public function getImage() |
646
|
|
|
{ |
647
|
|
|
return $this->image; |
648
|
|
|
} |
649
|
|
|
|
650
|
|
|
/** |
651
|
|
|
* Sets the image |
652
|
|
|
* |
653
|
|
|
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $image Image |
654
|
|
|
* |
655
|
|
|
* @return void |
656
|
|
|
*/ |
657
|
|
|
public function setImage(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $image) |
658
|
|
|
{ |
659
|
|
|
$this->image = $image; |
660
|
|
|
} |
661
|
|
|
|
662
|
|
|
/** |
663
|
|
|
* Adds a file |
664
|
|
|
* |
665
|
|
|
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $file File |
666
|
|
|
* |
667
|
|
|
* @return void |
668
|
|
|
*/ |
669
|
|
|
public function addFiles(\TYPO3\CMS\Extbase\Domain\Model\FileReference $file) |
670
|
|
|
{ |
671
|
|
|
$this->files->attach($file); |
672
|
|
|
} |
673
|
|
|
|
674
|
|
|
/** |
675
|
|
|
* Removes a file |
676
|
|
|
* |
677
|
|
|
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $fileToRemove File |
678
|
|
|
* |
679
|
|
|
* @return void |
680
|
|
|
*/ |
681
|
|
|
public function removeFiles(\TYPO3\CMS\Extbase\Domain\Model\FileReference $fileToRemove) |
682
|
|
|
{ |
683
|
|
|
$this->files->detach($fileToRemove); |
684
|
|
|
} |
685
|
|
|
|
686
|
|
|
/** |
687
|
|
|
* Returns the files |
688
|
|
|
* |
689
|
|
|
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $files |
690
|
|
|
*/ |
691
|
|
|
public function getFiles() |
692
|
|
|
{ |
693
|
|
|
return $this->files; |
694
|
|
|
} |
695
|
|
|
|
696
|
|
|
/** |
697
|
|
|
* Sets the files |
698
|
|
|
* |
699
|
|
|
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $files Files |
700
|
|
|
* |
701
|
|
|
* @return void |
702
|
|
|
*/ |
703
|
|
|
public function setFiles(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $files) |
704
|
|
|
{ |
705
|
|
|
$this->files = $files; |
706
|
|
|
} |
707
|
|
|
|
708
|
|
|
/** |
709
|
|
|
* Returns YouTube embed code |
710
|
|
|
* |
711
|
|
|
* @return string |
712
|
|
|
*/ |
713
|
|
|
public function getYoutube() |
714
|
|
|
{ |
715
|
|
|
return $this->youtube; |
716
|
|
|
} |
717
|
|
|
|
718
|
|
|
/** |
719
|
|
|
* Sets YouTube embed code |
720
|
|
|
* |
721
|
|
|
* @param string $youtube Youtube |
722
|
|
|
* |
723
|
|
|
* @return void |
724
|
|
|
*/ |
725
|
|
|
public function setYoutube($youtube) |
726
|
|
|
{ |
727
|
|
|
$this->youtube = $youtube; |
728
|
|
|
} |
729
|
|
|
|
730
|
|
|
/** |
731
|
|
|
* Returns if the registration for this event is logically possible |
732
|
|
|
* |
733
|
|
|
* @return bool |
734
|
|
|
*/ |
735
|
|
|
public function getRegistrationPossible() |
736
|
|
|
{ |
737
|
|
|
$maxParticipantsNotReached = true; |
738
|
|
|
if ($this->getMaxParticipants() > 0 && $this->getRegistration()->count() >= $this->maxParticipants) { |
739
|
|
|
$maxParticipantsNotReached = false; |
740
|
|
|
} |
741
|
|
|
$deadlineNotReached = true; |
742
|
|
|
if ($this->getRegistrationDeadline() != null && $this->getRegistrationDeadline() <= new \DateTime()) { |
743
|
|
|
$deadlineNotReached = false; |
744
|
|
|
} |
745
|
|
|
return ($this->getStartdate() > new \DateTime()) && $maxParticipantsNotReached && |
746
|
|
|
$this->getEnableRegistration() && $deadlineNotReached; |
747
|
|
|
} |
748
|
|
|
|
749
|
|
|
/** |
750
|
|
|
* Returns the amount of free places |
751
|
|
|
* |
752
|
|
|
* @return int |
753
|
|
|
*/ |
754
|
|
|
public function getFreePlaces() |
755
|
|
|
{ |
756
|
|
|
return $this->maxParticipants - $this->getRegistration()->count(); |
757
|
|
|
} |
758
|
|
|
|
759
|
|
|
/** |
760
|
|
|
* Sets the location |
761
|
|
|
* |
762
|
|
|
* @param \DERHANSEN\SfEventMgt\Domain\Model\Location $location Location |
763
|
|
|
* |
764
|
|
|
* @return void |
765
|
|
|
*/ |
766
|
|
|
public function setLocation($location) |
767
|
|
|
{ |
768
|
|
|
$this->location = $location; |
769
|
|
|
} |
770
|
|
|
|
771
|
|
|
/** |
772
|
|
|
* Returns the location |
773
|
|
|
* |
774
|
|
|
* @return \DERHANSEN\SfEventMgt\Domain\Model\Location |
775
|
|
|
*/ |
776
|
|
|
public function getLocation() |
777
|
|
|
{ |
778
|
|
|
return $this->location; |
779
|
|
|
} |
780
|
|
|
|
781
|
|
|
/** |
782
|
|
|
* Sets enableRegistration |
783
|
|
|
* |
784
|
|
|
* @param bool $enableRegistration EnableRegistration |
785
|
|
|
* |
786
|
|
|
* @return void |
787
|
|
|
*/ |
788
|
|
|
public function setEnableRegistration($enableRegistration) |
789
|
|
|
{ |
790
|
|
|
$this->enableRegistration = $enableRegistration; |
791
|
|
|
} |
792
|
|
|
|
793
|
|
|
/** |
794
|
|
|
* Returns if registration is enabled |
795
|
|
|
* |
796
|
|
|
* @return bool |
797
|
|
|
*/ |
798
|
|
|
public function getEnableRegistration() |
799
|
|
|
{ |
800
|
|
|
return $this->enableRegistration; |
801
|
|
|
} |
802
|
|
|
|
803
|
|
|
/** |
804
|
|
|
* Sets the registration deadline |
805
|
|
|
* |
806
|
|
|
* @param \DateTime $registrationDeadline RegistrationDeadline |
807
|
|
|
* |
808
|
|
|
* @return void |
809
|
|
|
*/ |
810
|
|
|
public function setRegistrationDeadline(\DateTime $registrationDeadline) |
811
|
|
|
{ |
812
|
|
|
$this->registrationDeadline = $registrationDeadline; |
813
|
|
|
} |
814
|
|
|
|
815
|
|
|
/** |
816
|
|
|
* Returns the registration deadline |
817
|
|
|
* |
818
|
|
|
* @return \DateTime |
819
|
|
|
*/ |
820
|
|
|
public function getRegistrationDeadline() |
821
|
|
|
{ |
822
|
|
|
return $this->registrationDeadline; |
823
|
|
|
} |
824
|
|
|
|
825
|
|
|
/** |
826
|
|
|
* Sets the link |
827
|
|
|
* |
828
|
|
|
* @param string $link Link |
829
|
|
|
* |
830
|
|
|
* @return void |
831
|
|
|
*/ |
832
|
|
|
public function setLink($link) |
833
|
|
|
{ |
834
|
|
|
$this->link = $link; |
835
|
|
|
} |
836
|
|
|
|
837
|
|
|
/** |
838
|
|
|
* Returns the link |
839
|
|
|
* |
840
|
|
|
* @return string |
841
|
|
|
*/ |
842
|
|
|
public function getLink() |
843
|
|
|
{ |
844
|
|
|
return $this->link; |
845
|
|
|
} |
846
|
|
|
|
847
|
|
|
/** |
848
|
|
|
* Returns the uri of the link |
849
|
|
|
* |
850
|
|
|
* @return string |
851
|
|
|
*/ |
852
|
|
|
public function getLinkUrl() |
853
|
|
|
{ |
854
|
|
|
return $this->getLinkPart(0); |
855
|
|
|
} |
856
|
|
|
|
857
|
|
|
/** |
858
|
|
|
* Returns the target of the link |
859
|
|
|
* |
860
|
|
|
* @return string |
861
|
|
|
*/ |
862
|
|
|
public function getLinkTarget() |
863
|
|
|
{ |
864
|
|
|
return $this->getLinkPart(1); |
865
|
|
|
} |
866
|
|
|
|
867
|
|
|
/** |
868
|
|
|
* Returns the title of the link |
869
|
|
|
* |
870
|
|
|
* @return string |
871
|
|
|
*/ |
872
|
|
|
public function getLinkTitle() |
873
|
|
|
{ |
874
|
|
|
return $this->getLinkPart(3); |
875
|
|
|
} |
876
|
|
|
|
877
|
|
|
/** |
878
|
|
|
* Splits link to an array respection that a title with more than one word is |
879
|
|
|
* surrounded by quotation marks. Returns part of the link for usage in fluid |
880
|
|
|
* viewhelpers. |
881
|
|
|
* |
882
|
|
|
* @param int $part The part |
883
|
|
|
* |
884
|
|
|
* @return string |
885
|
|
|
*/ |
886
|
|
|
public function getLinkPart($part) |
887
|
|
|
{ |
888
|
|
|
$linkArray = str_getcsv($this->link, ' ', '"'); |
889
|
|
|
$ret = ''; |
890
|
|
|
if (count($linkArray) >= $part) { |
891
|
|
|
$ret = $linkArray[$part]; |
892
|
|
|
} |
893
|
|
|
if ($ret === '-') { |
894
|
|
|
$ret = ''; |
895
|
|
|
} |
896
|
|
|
return $ret; |
897
|
|
|
} |
898
|
|
|
|
899
|
|
|
/** |
900
|
|
|
* Sets topEvent |
901
|
|
|
* |
902
|
|
|
* @param bool $topEvent TopEvent |
903
|
|
|
* |
904
|
|
|
* @return void |
905
|
|
|
*/ |
906
|
|
|
public function setTopEvent($topEvent) |
907
|
|
|
{ |
908
|
|
|
$this->topEvent = $topEvent; |
909
|
|
|
} |
910
|
|
|
|
911
|
|
|
/** |
912
|
|
|
* Returns if topEvent is checked |
913
|
|
|
* |
914
|
|
|
* @return bool |
915
|
|
|
*/ |
916
|
|
|
public function getTopEvent() |
917
|
|
|
{ |
918
|
|
|
return $this->topEvent; |
919
|
|
|
} |
920
|
|
|
|
921
|
|
|
/** |
922
|
|
|
* Returns max regisrations per user |
923
|
|
|
* |
924
|
|
|
* @return int |
925
|
|
|
*/ |
926
|
|
|
public function getMaxRegistrationsPerUser() |
927
|
|
|
{ |
928
|
|
|
return $this->maxRegistrationsPerUser; |
929
|
|
|
} |
930
|
|
|
|
931
|
|
|
/** |
932
|
|
|
* Sets max registrations per user |
933
|
|
|
* |
934
|
|
|
* @param int $maxRegistrationsPerUser MaxRegistrationsPerUser |
935
|
|
|
* |
936
|
|
|
* @return void |
937
|
|
|
*/ |
938
|
|
|
public function setMaxRegistrationsPerUser($maxRegistrationsPerUser) |
939
|
|
|
{ |
940
|
|
|
$this->maxRegistrationsPerUser = $maxRegistrationsPerUser; |
941
|
|
|
} |
942
|
|
|
|
943
|
|
|
|
944
|
|
|
/** |
945
|
|
|
* Adds an additionalImage |
946
|
|
|
* |
947
|
|
|
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $additionalImage The Image |
948
|
|
|
* |
949
|
|
|
* @return void |
950
|
|
|
*/ |
951
|
|
|
public function addAdditionalImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $additionalImage) |
952
|
|
|
{ |
953
|
|
|
$this->additionalImage->attach($additionalImage); |
954
|
|
|
} |
955
|
|
|
|
956
|
|
|
/** |
957
|
|
|
* Removes an additionalImage |
958
|
|
|
* |
959
|
|
|
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $additionalImageToRemove The Image |
960
|
|
|
* |
961
|
|
|
* @return void |
962
|
|
|
*/ |
963
|
|
|
public function removeAdditionalImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $additionalImageToRemove) |
964
|
|
|
{ |
965
|
|
|
$this->additionalImage->detach($additionalImageToRemove); |
966
|
|
|
} |
967
|
|
|
|
968
|
|
|
/** |
969
|
|
|
* Returns the additionalImage |
970
|
|
|
* |
971
|
|
|
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $additionalImage |
972
|
|
|
*/ |
973
|
|
|
public function getAdditionalImage() |
974
|
|
|
{ |
975
|
|
|
return $this->additionalImage; |
976
|
|
|
} |
977
|
|
|
|
978
|
|
|
/** |
979
|
|
|
* Sets the additionalImage |
980
|
|
|
* |
981
|
|
|
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $additionalImage The Image |
982
|
|
|
* |
983
|
|
|
* @return void |
984
|
|
|
*/ |
985
|
|
|
public function setAdditionalImage(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $additionalImage) |
986
|
|
|
{ |
987
|
|
|
$this->additionalImage = $additionalImage; |
988
|
|
|
} |
989
|
|
|
|
990
|
|
|
/** |
991
|
|
|
* Returns the organisator |
992
|
|
|
* |
993
|
|
|
* @return Organisator |
994
|
|
|
*/ |
995
|
|
|
public function getOrganisator() |
996
|
|
|
{ |
997
|
|
|
return $this->organisator; |
998
|
|
|
} |
999
|
|
|
|
1000
|
|
|
/** |
1001
|
|
|
* Sets the organisator |
1002
|
|
|
* |
1003
|
|
|
* @param Organisator $organisator The organisator |
1004
|
|
|
* |
1005
|
|
|
* @return void |
1006
|
|
|
*/ |
1007
|
|
|
public function setOrganisator($organisator) |
1008
|
|
|
{ |
1009
|
|
|
$this->organisator = $organisator; |
1010
|
|
|
} |
1011
|
|
|
|
1012
|
|
|
/** |
1013
|
|
|
* Returns notifyAdmin |
1014
|
|
|
* |
1015
|
|
|
* @return bool |
1016
|
|
|
*/ |
1017
|
|
|
public function getNotifyAdmin() |
1018
|
|
|
{ |
1019
|
|
|
return $this->notifyAdmin; |
1020
|
|
|
} |
1021
|
|
|
|
1022
|
|
|
/** |
1023
|
|
|
* Sets notifyAdmin |
1024
|
|
|
* |
1025
|
|
|
* @param bool $notifyAdmin NotifyAdmin |
1026
|
|
|
* |
1027
|
|
|
* @return void |
1028
|
|
|
*/ |
1029
|
|
|
public function setNotifyAdmin($notifyAdmin) |
1030
|
|
|
{ |
1031
|
|
|
$this->notifyAdmin = $notifyAdmin; |
1032
|
|
|
} |
1033
|
|
|
|
1034
|
|
|
/** |
1035
|
|
|
* Returns if notifyAdmin is set |
1036
|
|
|
* |
1037
|
|
|
* @return bool |
1038
|
|
|
*/ |
1039
|
|
|
public function getNotifyOrganisator() |
1040
|
|
|
{ |
1041
|
|
|
return $this->notifyOrganisator; |
1042
|
|
|
} |
1043
|
|
|
|
1044
|
|
|
/** |
1045
|
|
|
* Sets notifyOrganisator |
1046
|
|
|
* |
1047
|
|
|
* @param bool $notifyOrganisator NotifyOrganisator |
1048
|
|
|
* |
1049
|
|
|
* @return void |
1050
|
|
|
*/ |
1051
|
|
|
public function setNotifyOrganisator($notifyOrganisator) |
1052
|
|
|
{ |
1053
|
|
|
$this->notifyOrganisator = $notifyOrganisator; |
1054
|
|
|
} |
1055
|
|
|
|
1056
|
|
|
/** |
1057
|
|
|
* Sets enableCancel |
1058
|
|
|
* |
1059
|
|
|
* @param bool $enableCancel EnableCancel |
1060
|
|
|
* |
1061
|
|
|
* @return void |
1062
|
|
|
*/ |
1063
|
|
|
public function setEnableCancel($enableCancel) |
1064
|
|
|
{ |
1065
|
|
|
$this->enableCancel = $enableCancel; |
1066
|
|
|
} |
1067
|
|
|
|
1068
|
|
|
/** |
1069
|
|
|
* Returns if registration can be canceled |
1070
|
|
|
* |
1071
|
|
|
* @return bool |
1072
|
|
|
*/ |
1073
|
|
|
public function getEnableCancel() |
1074
|
|
|
{ |
1075
|
|
|
return $this->enableCancel; |
1076
|
|
|
} |
1077
|
|
|
|
1078
|
|
|
/** |
1079
|
|
|
* Sets the cancel deadline |
1080
|
|
|
* |
1081
|
|
|
* @param \DateTime $cancelDeadline RegistrationDeadline |
1082
|
|
|
* |
1083
|
|
|
* @return void |
1084
|
|
|
*/ |
1085
|
|
|
public function setCancelDeadline(\DateTime $cancelDeadline) |
1086
|
|
|
{ |
1087
|
|
|
$this->cancelDeadline = $cancelDeadline; |
1088
|
|
|
} |
1089
|
|
|
|
1090
|
|
|
/** |
1091
|
|
|
* Returns the cancel deadline |
1092
|
|
|
* |
1093
|
|
|
* @return \DateTime |
1094
|
|
|
*/ |
1095
|
|
|
public function getCancelDeadline() |
1096
|
|
|
{ |
1097
|
|
|
return $this->cancelDeadline; |
1098
|
|
|
} |
1099
|
|
|
|
1100
|
|
|
/** |
1101
|
|
|
* Returns uniqueEmailCheck |
1102
|
|
|
* |
1103
|
|
|
* @return boolean |
1104
|
|
|
*/ |
1105
|
|
|
public function getUniqueEmailCheck() |
1106
|
|
|
{ |
1107
|
|
|
return $this->uniqueEmailCheck; |
1108
|
|
|
} |
1109
|
|
|
|
1110
|
|
|
/** |
1111
|
|
|
* Sets UniqueEmailCheck |
1112
|
|
|
* |
1113
|
|
|
* @param boolean $uniqueEmailCheck |
1114
|
|
|
* @return void |
1115
|
|
|
*/ |
1116
|
|
|
public function setUniqueEmailCheck($uniqueEmailCheck) |
1117
|
|
|
{ |
1118
|
|
|
$this->uniqueEmailCheck = $uniqueEmailCheck; |
1119
|
|
|
} |
1120
|
|
|
|
1121
|
|
|
} |