Complex classes like Event often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Event, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
22 | class Event extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity |
||
23 | { |
||
24 | /** |
||
25 | * @var \DateTime |
||
26 | */ |
||
27 | protected $tstamp; |
||
28 | |||
29 | /** |
||
30 | * Title |
||
31 | * |
||
32 | * @var string |
||
33 | * @validate NotEmpty |
||
34 | */ |
||
35 | protected $title = ''; |
||
36 | |||
37 | /** |
||
38 | * Teaser |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $teaser = ''; |
||
43 | |||
44 | /** |
||
45 | * Description |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $description = ''; |
||
50 | |||
51 | /** |
||
52 | * Program/Schedule |
||
53 | * |
||
54 | * @var string |
||
55 | */ |
||
56 | protected $program = ''; |
||
57 | |||
58 | /** |
||
59 | * Startdate and time |
||
60 | * |
||
61 | * @var \DateTime |
||
62 | */ |
||
63 | protected $startdate = null; |
||
64 | |||
65 | /** |
||
66 | * Enddate and time |
||
67 | * |
||
68 | * @var \DateTime |
||
69 | */ |
||
70 | protected $enddate = null; |
||
71 | |||
72 | /** |
||
73 | * Max participants |
||
74 | * |
||
75 | * @var int |
||
76 | */ |
||
77 | protected $maxParticipants = 0; |
||
78 | |||
79 | /** |
||
80 | * Max registrations per user |
||
81 | * |
||
82 | * @var int |
||
83 | */ |
||
84 | protected $maxRegistrationsPerUser = 1; |
||
85 | |||
86 | /** |
||
87 | * Price |
||
88 | * |
||
89 | * @var float |
||
90 | */ |
||
91 | protected $price = 0.0; |
||
92 | |||
93 | /** |
||
94 | * Currency |
||
95 | * |
||
96 | * @var string |
||
97 | */ |
||
98 | protected $currency = ''; |
||
99 | |||
100 | /** |
||
101 | * Enable payment |
||
102 | * |
||
103 | * @var bool |
||
104 | */ |
||
105 | protected $enablePayment = false; |
||
106 | |||
107 | /** |
||
108 | * Restrict payment methods |
||
109 | * |
||
110 | * @var bool |
||
111 | */ |
||
112 | protected $restrictPaymentMethods = false; |
||
113 | |||
114 | /** |
||
115 | * Selected payment methods |
||
116 | * |
||
117 | * @var string |
||
118 | */ |
||
119 | protected $selectedPaymentMethods = ''; |
||
120 | |||
121 | /** |
||
122 | * Category |
||
123 | * |
||
124 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\DERHANSEN\SfEventMgt\Domain\Model\Category> |
||
125 | * @lazy |
||
126 | */ |
||
127 | protected $category = null; |
||
128 | |||
129 | /** |
||
130 | * Related |
||
131 | * |
||
132 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\DERHANSEN\SfEventMgt\Domain\Model\Event> |
||
133 | * @lazy |
||
134 | */ |
||
135 | protected $related; |
||
136 | |||
137 | /** |
||
138 | * Registration |
||
139 | * |
||
140 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\DERHANSEN\SfEventMgt\Domain\Model\Registration> |
||
141 | * @cascade remove |
||
142 | * @lazy |
||
143 | */ |
||
144 | protected $registration = null; |
||
145 | |||
146 | /** |
||
147 | * Registration waitlist |
||
148 | * |
||
149 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\DERHANSEN\SfEventMgt\Domain\Model\Registration> |
||
150 | * @lazy |
||
151 | */ |
||
152 | protected $registrationWaitlist; |
||
153 | |||
154 | /** |
||
155 | * Registration fields |
||
156 | * |
||
157 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\DERHANSEN\SfEventMgt\Domain\Model\Registration\Field> |
||
158 | * @lazy |
||
159 | */ |
||
160 | protected $registrationFields; |
||
161 | |||
162 | /** |
||
163 | * Registration deadline date |
||
164 | * |
||
165 | * @var \DateTime |
||
166 | */ |
||
167 | protected $registrationDeadline = null; |
||
168 | |||
169 | /** |
||
170 | * The image |
||
171 | * |
||
172 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> |
||
173 | * @lazy |
||
174 | */ |
||
175 | protected $image = null; |
||
176 | |||
177 | /** |
||
178 | * Additional files |
||
179 | * |
||
180 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> |
||
181 | * @lazy |
||
182 | */ |
||
183 | protected $files = null; |
||
184 | |||
185 | /** |
||
186 | * The Location |
||
187 | * |
||
188 | * @var \DERHANSEN\SfEventMgt\Domain\Model\Location |
||
189 | */ |
||
190 | protected $location = null; |
||
191 | |||
192 | /** |
||
193 | * Room |
||
194 | * |
||
195 | * @var string |
||
196 | */ |
||
197 | protected $room; |
||
198 | |||
199 | /** |
||
200 | * Enable registration |
||
201 | * |
||
202 | * @var bool |
||
203 | */ |
||
204 | protected $enableRegistration = false; |
||
205 | |||
206 | /** |
||
207 | * Enable waitlist |
||
208 | * |
||
209 | * @var bool |
||
210 | */ |
||
211 | protected $enableWaitlist = false; |
||
212 | |||
213 | /** |
||
214 | * Link |
||
215 | * |
||
216 | * @var string |
||
217 | */ |
||
218 | protected $link; |
||
219 | |||
220 | /** |
||
221 | * Top event |
||
222 | * |
||
223 | * @var bool |
||
224 | */ |
||
225 | protected $topEvent = false; |
||
226 | |||
227 | /** |
||
228 | * The additionalImage |
||
229 | * |
||
230 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> |
||
231 | * @lazy |
||
232 | */ |
||
233 | protected $additionalImage = null; |
||
234 | |||
235 | /** |
||
236 | * The organisator |
||
237 | * |
||
238 | * @var \DERHANSEN\SfEventMgt\Domain\Model\Organisator |
||
239 | */ |
||
240 | protected $organisator = null; |
||
241 | |||
242 | /** |
||
243 | * Notify admin |
||
244 | * |
||
245 | * @var bool |
||
246 | */ |
||
247 | protected $notifyAdmin = true; |
||
248 | |||
249 | /** |
||
250 | * Notify organisator |
||
251 | * |
||
252 | * @var bool |
||
253 | */ |
||
254 | protected $notifyOrganisator = false; |
||
255 | |||
256 | /** |
||
257 | * Enable cancel of registration |
||
258 | * |
||
259 | * @var bool |
||
260 | */ |
||
261 | protected $enableCancel = false; |
||
262 | |||
263 | /** |
||
264 | * Deadline for cancel |
||
265 | * |
||
266 | * @var \DateTime |
||
267 | */ |
||
268 | protected $cancelDeadline = null; |
||
269 | |||
270 | /** |
||
271 | * Enable auto confirmation |
||
272 | * |
||
273 | * @var bool |
||
274 | */ |
||
275 | protected $enableAutoconfirm = false; |
||
276 | |||
277 | 362 | /** |
|
278 | * Unique e-mail check |
||
279 | 362 | * |
|
280 | 362 | * @var bool |
|
281 | 362 | */ |
|
282 | 362 | protected $uniqueEmailCheck = false; |
|
283 | 362 | ||
284 | 362 | /** |
|
285 | 362 | * Price options |
|
286 | 362 | * |
|
287 | 362 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\DERHANSEN\SfEventMgt\Domain\Model\PriceOption> |
|
288 | * @cascade remove |
||
289 | * @lazy |
||
290 | */ |
||
291 | protected $priceOptions = null; |
||
292 | |||
293 | /** |
||
294 | 10 | * Speaker |
|
295 | * |
||
296 | 10 | * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\DERHANSEN\SfEventMgt\Domain\Model\Speaker> |
|
297 | * @lazy |
||
298 | */ |
||
299 | protected $speaker = null; |
||
300 | |||
301 | /** |
||
302 | * Constructor |
||
303 | */ |
||
304 | public function __construct() |
||
317 | |||
318 | 2 | /** |
|
319 | * Get timestamp |
||
320 | * |
||
321 | * @return \DateTime |
||
322 | */ |
||
323 | public function getTstamp() |
||
327 | |||
328 | 2 | /** |
|
329 | * Set time stamp |
||
330 | 2 | * |
|
331 | 2 | * @param \DateTime $tstamp time stamp |
|
332 | */ |
||
333 | public function setTstamp($tstamp) |
||
337 | |||
338 | 2 | /** |
|
339 | * Returns the title |
||
340 | 2 | * |
|
341 | * @return string $title |
||
342 | */ |
||
343 | public function getTitle() |
||
347 | |||
348 | /** |
||
349 | * Sets the title |
||
350 | 2 | * |
|
351 | * @param string $title Title |
||
352 | 2 | * |
|
353 | 2 | * @return void |
|
354 | */ |
||
355 | public function setTitle($title) |
||
359 | |||
360 | 2 | /** |
|
361 | * Returns the teaser |
||
362 | 2 | * |
|
363 | * @return string |
||
364 | */ |
||
365 | public function getTeaser() |
||
369 | |||
370 | /** |
||
371 | * Sets the teaser |
||
372 | 2 | * |
|
373 | * @param string $teaser Teaser |
||
374 | 2 | * |
|
375 | 2 | * @return void |
|
376 | */ |
||
377 | public function setTeaser($teaser) |
||
381 | |||
382 | 22 | /** |
|
383 | * Returns the description |
||
384 | 22 | * |
|
385 | * @return string $description |
||
386 | */ |
||
387 | public function getDescription() |
||
391 | |||
392 | /** |
||
393 | * Sets the description |
||
394 | 22 | * |
|
395 | * @param string $description Description |
||
396 | 22 | * |
|
397 | 22 | * @return void |
|
398 | */ |
||
399 | public function setDescription($description) |
||
403 | |||
404 | 2 | /** |
|
405 | * Returns the program |
||
406 | 2 | * |
|
407 | * @return string $program |
||
408 | */ |
||
409 | public function getProgram() |
||
413 | |||
414 | /** |
||
415 | * Sets the program |
||
416 | 2 | * |
|
417 | * @param string $program The program |
||
418 | 2 | * |
|
419 | 2 | * @return void |
|
420 | */ |
||
421 | public function setProgram($program) |
||
425 | |||
426 | 28 | /** |
|
427 | * Returns the startdate |
||
428 | 28 | * |
|
429 | * @return \DateTime $startdate |
||
430 | */ |
||
431 | public function getStartdate() |
||
435 | |||
436 | /** |
||
437 | * Sets the startdate |
||
438 | 26 | * |
|
439 | * @param \DateTime $startdate Startdate |
||
440 | 26 | * |
|
441 | 26 | * @return void |
|
442 | */ |
||
443 | public function setStartdate(\DateTime $startdate) |
||
447 | |||
448 | 2 | /** |
|
449 | * Returns the enddate |
||
450 | 2 | * |
|
451 | * @return \DateTime $enddate |
||
452 | */ |
||
453 | public function getEnddate() |
||
457 | |||
458 | /** |
||
459 | * Sets the enddate |
||
460 | 6 | * |
|
461 | * @param \DateTime $enddate Enddate |
||
462 | 6 | * |
|
463 | 6 | * @return void |
|
464 | */ |
||
465 | public function setEnddate(\DateTime $enddate) |
||
469 | |||
470 | 2 | /** |
|
471 | * Returns the participants |
||
472 | 2 | * |
|
473 | * @return int $participants |
||
474 | */ |
||
475 | public function getMaxParticipants() |
||
479 | |||
480 | /** |
||
481 | * Sets the participants |
||
482 | 2 | * |
|
483 | * @param int $participants Participants |
||
484 | 2 | * |
|
485 | 2 | * @return void |
|
486 | */ |
||
487 | public function setMaxParticipants($participants) |
||
491 | |||
492 | 8 | /** |
|
493 | * Returns the price |
||
494 | 8 | * |
|
495 | * @return float $price |
||
496 | */ |
||
497 | public function getPrice() |
||
501 | |||
502 | /** |
||
503 | 6 | * Sets the price |
|
504 | * |
||
505 | 6 | * @param float $price Price |
|
506 | 6 | * |
|
507 | * @return void |
||
508 | */ |
||
509 | public function setPrice($price) |
||
513 | 6 | ||
514 | /** |
||
515 | 6 | * Returns the currency |
|
516 | * |
||
517 | * @return string $currency |
||
518 | */ |
||
519 | public function getCurrency() |
||
523 | |||
524 | 2 | /** |
|
525 | * Sets the currency |
||
526 | 2 | * |
|
527 | 2 | * @param string $currency Currency |
|
528 | * |
||
529 | * @return void |
||
530 | */ |
||
531 | public function setCurrency($currency) |
||
535 | |||
536 | 4 | /** |
|
537 | * Returns if payment is enabled |
||
538 | * |
||
539 | * @return bool |
||
540 | */ |
||
541 | public function getEnablePayment() |
||
545 | 2 | ||
546 | /** |
||
547 | 2 | * Sets enablePayment |
|
548 | 2 | * |
|
549 | * @param bool $enablePayment |
||
550 | * @return void |
||
551 | */ |
||
552 | public function setEnablePayment($enablePayment) |
||
556 | |||
557 | 2 | /** |
|
558 | * Returns if payment methods should be restricted |
||
559 | 2 | * |
|
560 | 2 | * @return bool |
|
561 | */ |
||
562 | public function getRestrictPaymentMethods() |
||
566 | |||
567 | /** |
||
568 | * Sets if payment methods should be restricted |
||
569 | 2 | * |
|
570 | * @param bool $restrictPaymentMethods |
||
571 | 2 | * @return void |
|
572 | 2 | */ |
|
573 | public function setRestrictPaymentMethods($restrictPaymentMethods) |
||
577 | |||
578 | /** |
||
579 | 2 | * Returns selected payment methods |
|
580 | * |
||
581 | 2 | * @return string |
|
582 | */ |
||
583 | public function getSelectedPaymentMethods() |
||
587 | |||
588 | /** |
||
589 | * Sets selected payment methods |
||
590 | * |
||
591 | 6 | * @param string $selectedPaymentMethods |
|
592 | * @return void |
||
593 | 6 | */ |
|
594 | 6 | public function setSelectedPaymentMethods($selectedPaymentMethods) |
|
598 | |||
599 | /** |
||
600 | * Adds a Category |
||
601 | 4 | * |
|
602 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Category $category Category |
||
603 | 4 | * |
|
604 | * @return void |
||
605 | */ |
||
606 | public function addCategory(\DERHANSEN\SfEventMgt\Domain\Model\Category $category) |
||
610 | |||
611 | /** |
||
612 | 6 | * Removes a Category |
|
613 | * |
||
614 | 6 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Category $categoryToRemove The Category to be removed |
|
615 | 6 | * |
|
616 | * @return void |
||
617 | */ |
||
618 | public function removeCategory(\DERHANSEN\SfEventMgt\Domain\Model\Category $categoryToRemove) |
||
622 | |||
623 | 2 | /** |
|
624 | * Returns the category |
||
625 | 2 | * |
|
626 | 2 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage |
|
627 | */ |
||
628 | public function getCategory() |
||
632 | |||
633 | /** |
||
634 | 2 | * Sets the category |
|
635 | * |
||
636 | 2 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $category Category |
|
637 | 2 | * |
|
638 | * @return void |
||
639 | */ |
||
640 | public function setCategory(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $category) |
||
644 | |||
645 | /** |
||
646 | 4 | * Returns related events |
|
647 | * |
||
648 | 4 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage |
|
649 | 4 | */ |
|
650 | public function getRelated() |
||
654 | |||
655 | /** |
||
656 | * Sets related events |
||
657 | * |
||
658 | 2 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $related |
|
659 | * @return void |
||
660 | 2 | */ |
|
661 | 2 | public function setRelated($related) |
|
665 | |||
666 | /** |
||
667 | * Adds a related event |
||
668 | 24 | * |
|
669 | * @param Event $event |
||
670 | 24 | * @return void |
|
671 | */ |
||
672 | public function addRelated(\DERHANSEN\SfEventMgt\Domain\Model\Event $event) |
||
676 | |||
677 | /** |
||
678 | * Removes a related event |
||
679 | * |
||
680 | 18 | * @param Event $event |
|
681 | * @return void |
||
682 | 18 | */ |
|
683 | 18 | public function removeRelated(\DERHANSEN\SfEventMgt\Domain\Model\Event $event) |
|
687 | |||
688 | /** |
||
689 | * Adds a Registration |
||
690 | * |
||
691 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration Registration |
||
692 | 2 | * |
|
693 | * @return void |
||
694 | 2 | */ |
|
695 | 2 | public function addRegistration(\DERHANSEN\SfEventMgt\Domain\Model\Registration $registration) |
|
699 | |||
700 | /** |
||
701 | * Removes a Registration |
||
702 | * |
||
703 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registrationToRemove Registration |
||
704 | 2 | * |
|
705 | * @return void |
||
706 | 2 | */ |
|
707 | 2 | public function removeRegistration(\DERHANSEN\SfEventMgt\Domain\Model\Registration $registrationToRemove) |
|
711 | |||
712 | /** |
||
713 | * Returns the Registration |
||
714 | 2 | * |
|
715 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $registration |
||
716 | 2 | */ |
|
717 | public function getRegistration() |
||
721 | |||
722 | /** |
||
723 | * Sets the Registration |
||
724 | * |
||
725 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $registration Registration |
||
726 | 6 | * |
|
727 | * @return void |
||
728 | 6 | */ |
|
729 | 6 | public function setRegistration(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $registration) |
|
733 | |||
734 | /** |
||
735 | * Adds an image |
||
736 | * |
||
737 | * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $image Image |
||
738 | 4 | * |
|
739 | * @return void |
||
740 | 4 | */ |
|
741 | 4 | public function addImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $image) |
|
745 | |||
746 | /** |
||
747 | * Removes an image |
||
748 | * |
||
749 | * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $imageToRemove Image |
||
750 | 2 | * |
|
751 | * @return void |
||
752 | 2 | */ |
|
753 | 2 | public function removeImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $imageToRemove) |
|
757 | |||
758 | /** |
||
759 | * Returns the image |
||
760 | 2 | * |
|
761 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $image |
||
762 | 2 | */ |
|
763 | public function getImage() |
||
767 | |||
768 | /** |
||
769 | * Sets the image |
||
770 | * |
||
771 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $image Image |
||
772 | 6 | * |
|
773 | * @return void |
||
774 | 6 | */ |
|
775 | 6 | public function setImage(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $image) |
|
779 | |||
780 | /** |
||
781 | * Adds a file |
||
782 | 4 | * |
|
783 | * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $file File |
||
784 | 4 | * |
|
785 | * @return void |
||
786 | */ |
||
787 | public function addFiles(\TYPO3\CMS\Extbase\Domain\Model\FileReference $file) |
||
791 | |||
792 | /** |
||
793 | * Removes a file |
||
794 | 2 | * |
|
795 | * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $fileToRemove File |
||
796 | 2 | * |
|
797 | 2 | * @return void |
|
798 | */ |
||
799 | public function removeFiles(\TYPO3\CMS\Extbase\Domain\Model\FileReference $fileToRemove) |
||
803 | |||
804 | 20 | /** |
|
805 | * Returns the files |
||
806 | 20 | * |
|
807 | 20 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $files |
|
808 | 6 | */ |
|
809 | 6 | public function getFiles() |
|
813 | 2 | ||
814 | 20 | /** |
|
815 | 20 | * Sets the files |
|
816 | 20 | * |
|
817 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $files Files |
||
818 | * |
||
819 | * @return void |
||
820 | */ |
||
821 | public function setFiles(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $files) |
||
825 | |||
826 | 10 | /** |
|
827 | * Returns if the registration for this event is logically possible |
||
828 | * |
||
829 | * @return bool |
||
830 | */ |
||
831 | public function getRegistrationPossible() |
||
846 | 2 | ||
847 | /** |
||
848 | 2 | * Returns the amount of free places |
|
849 | * |
||
850 | * @return int |
||
851 | */ |
||
852 | public function getFreePlaces() |
||
856 | |||
857 | /** |
||
858 | 20 | * Sets the location |
|
859 | * |
||
860 | 20 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Location $location Location |
|
861 | 20 | * |
|
862 | * @return void |
||
863 | */ |
||
864 | public function setLocation($location) |
||
868 | 16 | ||
869 | /** |
||
870 | 16 | * Returns the location |
|
871 | * |
||
872 | * @return \DERHANSEN\SfEventMgt\Domain\Model\Location |
||
873 | */ |
||
874 | public function getLocation() |
||
878 | 8 | ||
879 | /** |
||
880 | 8 | * Returns the room |
|
881 | * |
||
882 | * @return string |
||
883 | */ |
||
884 | public function getRoom() |
||
888 | |||
889 | 10 | /** |
|
890 | * Sets the room |
||
891 | 10 | * |
|
892 | 10 | * @param string $room |
|
893 | */ |
||
894 | public function setRoom($room) |
||
898 | |||
899 | /** |
||
900 | * Sets enableRegistration |
||
901 | 6 | * |
|
902 | * @param bool $enableRegistration EnableRegistration |
||
903 | 6 | * |
|
904 | 6 | * @return void |
|
905 | */ |
||
906 | public function setEnableRegistration($enableRegistration) |
||
910 | |||
911 | 22 | /** |
|
912 | * Returns if registration is enabled |
||
913 | 22 | * |
|
914 | * @return bool |
||
915 | */ |
||
916 | public function getEnableRegistration() |
||
920 | |||
921 | /** |
||
922 | * Returns enableWaitlist |
||
923 | 24 | * |
|
924 | * @return bool |
||
925 | 24 | */ |
|
926 | 24 | public function getEnableWaitlist() |
|
930 | |||
931 | /** |
||
932 | * Sets enableWaitlist |
||
933 | 2 | * |
|
934 | * @param bool $enableWaitlist |
||
935 | 2 | * @return void |
|
936 | */ |
||
937 | public function setEnableWaitlist($enableWaitlist) |
||
941 | |||
942 | /** |
||
943 | 2 | * Sets the registration deadline |
|
944 | * |
||
945 | 2 | * @param \DateTime $registrationDeadline RegistrationDeadline |
|
946 | * |
||
947 | * @return void |
||
948 | */ |
||
949 | public function setRegistrationDeadline(\DateTime $registrationDeadline) |
||
953 | 2 | ||
954 | /** |
||
955 | 2 | * Returns the registration deadline |
|
956 | * |
||
957 | * @return \DateTime |
||
958 | */ |
||
959 | public function getRegistrationDeadline() |
||
963 | 2 | ||
964 | /** |
||
965 | 2 | * Sets the link |
|
966 | * |
||
967 | * @param string $link Link |
||
968 | * |
||
969 | * @return void |
||
970 | */ |
||
971 | public function setLink($link) |
||
975 | |||
976 | /** |
||
977 | 22 | * Returns the link |
|
978 | * |
||
979 | 22 | * @return string |
|
980 | 22 | */ |
|
981 | 22 | public function getLink() |
|
985 | 2 | ||
986 | 2 | /** |
|
987 | 22 | * Sets topEvent |
|
988 | * |
||
989 | * @param bool $topEvent TopEvent |
||
990 | * |
||
991 | * @return void |
||
992 | */ |
||
993 | public function setTopEvent($topEvent) |
||
997 | 2 | ||
998 | /** |
||
999 | 2 | * Returns if topEvent is checked |
|
1000 | 2 | * |
|
1001 | * @return bool |
||
1002 | */ |
||
1003 | public function getTopEvent() |
||
1007 | 2 | ||
1008 | /** |
||
1009 | 2 | * Returns max regisrations per user |
|
1010 | * |
||
1011 | * @return int |
||
1012 | */ |
||
1013 | public function getMaxRegistrationsPerUser() |
||
1017 | 4 | ||
1018 | /** |
||
1019 | 4 | * Sets max registrations per user |
|
1020 | * |
||
1021 | * @param int $maxRegistrationsPerUser MaxRegistrationsPerUser |
||
1022 | * |
||
1023 | * @return void |
||
1024 | */ |
||
1025 | public function setMaxRegistrationsPerUser($maxRegistrationsPerUser) |
||
1029 | 2 | ||
1030 | /** |
||
1031 | 2 | * Adds an additionalImage |
|
1032 | 2 | * |
|
1033 | * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $additionalImage The Image |
||
1034 | * |
||
1035 | * @return void |
||
1036 | */ |
||
1037 | public function addAdditionalImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $additionalImage) |
||
1041 | |||
1042 | 2 | /** |
|
1043 | * Removes an additionalImage |
||
1044 | 2 | * |
|
1045 | 2 | * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $additionalImageToRemove The Image |
|
1046 | * |
||
1047 | * @return void |
||
1048 | */ |
||
1049 | public function removeAdditionalImage(\TYPO3\CMS\Extbase\Domain\Model\FileReference $additionalImageToRemove) |
||
1053 | |||
1054 | 2 | /** |
|
1055 | * Returns the additionalImage |
||
1056 | 2 | * |
|
1057 | 2 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $additionalImage |
|
1058 | */ |
||
1059 | public function getAdditionalImage() |
||
1063 | |||
1064 | 2 | /** |
|
1065 | * Sets the additionalImage |
||
1066 | 2 | * |
|
1067 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $additionalImage The Image |
||
1068 | * |
||
1069 | * @return void |
||
1070 | */ |
||
1071 | public function setAdditionalImage(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $additionalImage) |
||
1075 | |||
1076 | 6 | /** |
|
1077 | * Returns the organisator |
||
1078 | 6 | * |
|
1079 | 6 | * @return Organisator |
|
1080 | */ |
||
1081 | public function getOrganisator() |
||
1085 | |||
1086 | 12 | /** |
|
1087 | * Sets the organisator |
||
1088 | 12 | * |
|
1089 | * @param Organisator $organisator The organisator |
||
1090 | * |
||
1091 | * @return void |
||
1092 | */ |
||
1093 | public function setOrganisator($organisator) |
||
1097 | |||
1098 | 12 | /** |
|
1099 | * Returns notifyAdmin |
||
1100 | 12 | * |
|
1101 | 12 | * @return bool |
|
1102 | */ |
||
1103 | public function getNotifyAdmin() |
||
1107 | |||
1108 | 54 | /** |
|
1109 | * Sets notifyAdmin |
||
1110 | 54 | * |
|
1111 | * @param bool $notifyAdmin NotifyAdmin |
||
1112 | * |
||
1113 | * @return void |
||
1114 | */ |
||
1115 | public function setNotifyAdmin($notifyAdmin) |
||
1119 | |||
1120 | 22 | /** |
|
1121 | * Returns if notifyAdmin is set |
||
1122 | 22 | * |
|
1123 | 22 | * @return bool |
|
1124 | */ |
||
1125 | public function getNotifyOrganisator() |
||
1129 | |||
1130 | 54 | /** |
|
1131 | * Sets notifyOrganisator |
||
1132 | 54 | * |
|
1133 | * @param bool $notifyOrganisator NotifyOrganisator |
||
1134 | * |
||
1135 | * @return void |
||
1136 | */ |
||
1137 | public function setNotifyOrganisator($notifyOrganisator) |
||
1141 | |||
1142 | 22 | /** |
|
1143 | * Sets enableCancel |
||
1144 | 22 | * |
|
1145 | 22 | * @param bool $enableCancel EnableCancel |
|
1146 | * |
||
1147 | * @return void |
||
1148 | */ |
||
1149 | public function setEnableCancel($enableCancel) |
||
1153 | |||
1154 | 8 | /** |
|
1155 | * Returns if registration can be canceled |
||
1156 | 8 | * |
|
1157 | 8 | * @return bool |
|
1158 | */ |
||
1159 | public function getEnableCancel() |
||
1163 | |||
1164 | 10 | /** |
|
1165 | * Sets the cancel deadline |
||
1166 | 10 | * |
|
1167 | * @param \DateTime $cancelDeadline CancelDeadline |
||
1168 | * |
||
1169 | * @return void |
||
1170 | */ |
||
1171 | public function setCancelDeadline(\DateTime $cancelDeadline) |
||
1175 | |||
1176 | 8 | /** |
|
1177 | * Returns the cancel deadline |
||
1178 | 8 | * |
|
1179 | 8 | * @return \DateTime |
|
1180 | */ |
||
1181 | public function getCancelDeadline() |
||
1185 | |||
1186 | 8 | /** |
|
1187 | * Returns if autoconfirmation is enabled |
||
1188 | 8 | * |
|
1189 | * @return bool |
||
1190 | */ |
||
1191 | public function getEnableAutoconfirm() |
||
1195 | |||
1196 | 4 | /** |
|
1197 | * Sets enable autoconfirm |
||
1198 | 4 | * |
|
1199 | * @param bool $enableAutoconfirm |
||
1200 | * @return void |
||
1201 | */ |
||
1202 | public function setEnableAutoconfirm($enableAutoconfirm) |
||
1206 | |||
1207 | 2 | /** |
|
1208 | * Returns uniqueEmailCheck |
||
1209 | 2 | * |
|
1210 | 2 | * @return bool |
|
1211 | */ |
||
1212 | public function getUniqueEmailCheck() |
||
1216 | |||
1217 | 10 | /** |
|
1218 | * Sets UniqueEmailCheck |
||
1219 | 10 | * |
|
1220 | * @param bool $uniqueEmailCheck |
||
1221 | * @return void |
||
1222 | */ |
||
1223 | public function setUniqueEmailCheck($uniqueEmailCheck) |
||
1227 | |||
1228 | 6 | /** |
|
1229 | * Returns price options |
||
1230 | 6 | * |
|
1231 | 6 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage |
|
1232 | */ |
||
1233 | public function getPriceOptions() |
||
1237 | |||
1238 | /** |
||
1239 | * Sets price options |
||
1240 | 6 | * |
|
1241 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $priceOptions |
||
1242 | 6 | * @return void |
|
1243 | 6 | */ |
|
1244 | public function setPriceOptions($priceOptions) |
||
1248 | |||
1249 | /** |
||
1250 | * Adds a price option |
||
1251 | * |
||
1252 | 2 | * @param \DERHANSEN\SfEventMgt\Domain\Model\PriceOption $priceOption Price option |
|
1253 | * |
||
1254 | 2 | * @return void |
|
1255 | 2 | */ |
|
1256 | public function addPriceOptions(\DERHANSEN\SfEventMgt\Domain\Model\PriceOption $priceOption) |
||
1260 | |||
1261 | /** |
||
1262 | 6 | * Removes a Registration |
|
1263 | * |
||
1264 | 6 | * @param \DERHANSEN\SfEventMgt\Domain\Model\PriceOption $priceOption Price option |
|
1265 | 6 | * |
|
1266 | 6 | * @return void |
|
1267 | 6 | */ |
|
1268 | 4 | public function removePriceOptions(\DERHANSEN\SfEventMgt\Domain\Model\PriceOption $priceOption) |
|
1272 | 6 | ||
1273 | 6 | /** |
|
1274 | 6 | * Returns all active price options sorted by date ASC |
|
1275 | * |
||
1276 | * @return array |
||
1277 | */ |
||
1278 | public function getActivePriceOptions() |
||
1293 | |||
1294 | /** |
||
1295 | * Returns the current price of the event respecting possible price options |
||
1296 | * |
||
1297 | * @return float |
||
1298 | */ |
||
1299 | 2 | public function getCurrentPrice() |
|
1309 | |||
1310 | /** |
||
1311 | 6 | * Returns registrationWaitlist |
|
1312 | * |
||
1313 | 6 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage |
|
1314 | 6 | */ |
|
1315 | public function getRegistrationWaitlist() |
||
1319 | |||
1320 | /** |
||
1321 | * Sets registrationWaitlist |
||
1322 | * |
||
1323 | 2 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $registration Registration |
|
1324 | * |
||
1325 | 2 | * @return void |
|
1326 | 2 | */ |
|
1327 | public function setRegistrationWaitlist(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $registration) |
||
1331 | |||
1332 | /** |
||
1333 | * Adds a Registration to the waitlist |
||
1334 | * |
||
1335 | 2 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration Registration |
|
1336 | * |
||
1337 | 2 | * @return void |
|
1338 | 2 | */ |
|
1339 | public function addRegistrationWaitlist(\DERHANSEN\SfEventMgt\Domain\Model\Registration $registration) |
||
1343 | |||
1344 | /** |
||
1345 | 6 | * Removes a Registration from the waitlist |
|
1346 | * |
||
1347 | 6 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registrationToRemove Registration |
|
1348 | * |
||
1349 | * @return void |
||
1350 | */ |
||
1351 | public function removeRegistrationWaitlist(\DERHANSEN\SfEventMgt\Domain\Model\Registration $registrationToRemove) |
||
1355 | |||
1356 | /** |
||
1357 | * Returns, if cancellation for registrations of the event is possible |
||
1358 | * |
||
1359 | * @return bool |
||
1360 | */ |
||
1361 | public function getCancellationPossible() |
||
1366 | |||
1367 | /** |
||
1368 | * Returns speaker |
||
1369 | * |
||
1370 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage |
||
1371 | */ |
||
1372 | public function getSpeaker() |
||
1376 | |||
1377 | /** |
||
1378 | * Sets speaker |
||
1379 | * |
||
1380 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $speaker |
||
1381 | * @return void |
||
1382 | */ |
||
1383 | public function setSpeaker($speaker) |
||
1387 | |||
1388 | /** |
||
1389 | * Adds a speaker |
||
1390 | * |
||
1391 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Speaker $speaker |
||
1392 | * |
||
1393 | * @return void |
||
1394 | */ |
||
1395 | public function addSpeaker(\DERHANSEN\SfEventMgt\Domain\Model\Speaker $speaker) |
||
1399 | |||
1400 | /** |
||
1401 | * Removes a speaker |
||
1402 | * |
||
1403 | * @param \DERHANSEN\SfEventMgt\Domain\Model\Speaker $speaker |
||
1404 | * |
||
1405 | * @return void |
||
1406 | */ |
||
1407 | public function removeSpeaker(\DERHANSEN\SfEventMgt\Domain\Model\Speaker $speaker) |
||
1411 | |||
1412 | /** |
||
1413 | * Returns registrationFields |
||
1414 | * |
||
1415 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage |
||
1416 | */ |
||
1417 | public function getRegistrationFields() |
||
1421 | |||
1422 | /** |
||
1423 | * Sets registrationWaitlist |
||
1424 | * |
||
1425 | * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $registrationFields |
||
1426 | * |
||
1427 | * @return void |
||
1428 | */ |
||
1429 | public function setRegistrationFields(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $registrationFields) |
||
1433 | |||
1434 | /** |
||
1435 | * Adds a registrationField |
||
1436 | * |
||
1437 | * @param Field $registrationField |
||
1438 | */ |
||
1439 | public function addRegistrationFields(Field $registrationField) |
||
1443 | |||
1444 | /** |
||
1445 | * Removed a registrationField |
||
1446 | * |
||
1447 | * @param Field $registrationField |
||
1448 | */ |
||
1449 | public function removeRegistrationFields(Field $registrationField) |
||
1453 | |||
1454 | /** |
||
1455 | * Returns an array with registration field uids |
||
1456 | * |
||
1457 | * @return array |
||
1458 | */ |
||
1459 | public function getRegistrationFieldsUids() |
||
1468 | |||
1469 | /** |
||
1470 | * Returns an array with registration field uids and titles |
||
1471 | * [uid => title] |
||
1472 | * |
||
1473 | * @return array |
||
1474 | */ |
||
1475 | public function getRegistrationFieldUidsWithTitle() |
||
1484 | |||
1485 | /** |
||
1486 | * Special getter to return the amount of registrations that are saved to default language |
||
1487 | * Required since TYPO3 9.5 (#82363) |
||
1488 | * |
||
1489 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage |
||
1490 | */ |
||
1491 | public function getRegistrations() |
||
1499 | |||
1500 | /** |
||
1501 | * Special getter to return the amount of waitlist registrations that are saved to default language |
||
1502 | * Required since TYPO3 9.5 (#82363) |
||
1503 | * |
||
1504 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage |
||
1505 | */ |
||
1506 | public function getRegistrationsWaitlist() |
||
1515 | |||
1516 | /** |
||
1517 | * Returns an objectStorage object holding all registrations in the default language. |
||
1518 | * Ensures expected behavior of getRegistration() and getRegistrationWaitlist() since TYPO3 issue #82363 |
||
1519 | * |
||
1520 | * @param bool $waitlist |
||
1521 | * @return ObjectStorage |
||
1522 | */ |
||
1523 | protected function getRegistrationsDefaultLanguage(bool $waitlist = false) |
||
1535 | |||
1536 | /** |
||
1537 | * Returns if the event ends on the same day |
||
1538 | * |
||
1539 | * @return bool |
||
1540 | */ |
||
1541 | public function getEndsSameDay(): bool |
||
1549 | } |
||
1550 |