1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the Extension "sf_event_mgt" for TYPO3 CMS. |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please read the |
9
|
|
|
* LICENSE.txt file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace DERHANSEN\SfEventMgt\Event; |
13
|
|
|
|
14
|
|
|
use DERHANSEN\SfEventMgt\Controller\EventController; |
15
|
|
|
use DERHANSEN\SfEventMgt\Domain\Model\Registration; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* This event is triggered before depending registrations are created. Use setCreateDependingRegistrations to |
19
|
|
|
* override the original bahavior |
20
|
|
|
*/ |
21
|
|
|
final class ModifyCreateDependingRegistrationsEvent |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* @var Registration |
25
|
|
|
*/ |
26
|
|
|
private $registration; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var bool |
30
|
|
|
*/ |
31
|
|
|
private $createDependingRegistrations; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var EventController |
35
|
|
|
*/ |
36
|
|
|
private $eventController; |
37
|
|
|
|
38
|
|
|
public function __construct( |
39
|
|
|
Registration $registration, |
40
|
|
|
bool $createDependingRegistrations, |
41
|
|
|
EventController $eventController |
42
|
|
|
) { |
43
|
|
|
$this->registration = $registration; |
44
|
|
|
$this->createDependingRegistrations = $createDependingRegistrations; |
45
|
|
|
$this->eventController = $eventController; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @return Registration |
50
|
|
|
*/ |
51
|
|
|
public function getRegistration(): Registration |
52
|
|
|
{ |
53
|
|
|
return $this->registration; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @return EventController |
58
|
|
|
*/ |
59
|
|
|
public function getEventController(): EventController |
60
|
|
|
{ |
61
|
|
|
return $this->eventController; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @return bool |
66
|
|
|
*/ |
67
|
|
|
public function getCreateDependingRegistrations(): bool |
68
|
|
|
{ |
69
|
|
|
return $this->createDependingRegistrations; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @param bool $createDependingRegistrations |
74
|
|
|
*/ |
75
|
|
|
public function setCreateDependingRegistrations(bool $createDependingRegistrations): void |
76
|
|
|
{ |
77
|
|
|
$this->createDependingRegistrations = $createDependingRegistrations; |
78
|
|
|
} |
79
|
|
|
} |
80
|
|
|
|