1
|
|
|
<?php |
2
|
|
|
declare(strict_types = 1); |
3
|
|
|
namespace DERHANSEN\SfEventMgt\Event; |
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
|
|
|
use DERHANSEN\SfEventMgt\Controller\EventController; |
13
|
|
|
use DERHANSEN\SfEventMgt\Domain\Model\Registration; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* This event is triggered before depending registrations are created. Use setCreateDependingRegistrations to |
17
|
|
|
* override the original bahavior |
18
|
|
|
*/ |
19
|
|
|
final class ModifyCreateDependingRegistrationsEvent |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* @var Registration |
23
|
|
|
*/ |
24
|
|
|
private $registration; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var bool |
28
|
|
|
*/ |
29
|
|
|
private $createDependingRegistrations; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @var EventController |
33
|
|
|
*/ |
34
|
|
|
private $eventController; |
35
|
|
|
|
36
|
|
|
public function __construct( |
37
|
|
|
Registration $registration, |
38
|
|
|
bool $createDependingRegistrations, |
39
|
|
|
EventController $eventController |
40
|
|
|
) { |
41
|
|
|
$this->registration = $registration; |
42
|
|
|
$this->createDependingRegistrations = $createDependingRegistrations; |
43
|
|
|
$this->eventController = $eventController; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @return Registration |
48
|
|
|
*/ |
49
|
|
|
public function getRegistration(): Registration |
50
|
|
|
{ |
51
|
|
|
return $this->registration; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @return EventController |
56
|
|
|
*/ |
57
|
|
|
public function getEventController(): EventController |
58
|
|
|
{ |
59
|
|
|
return $this->eventController; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @return bool |
64
|
|
|
*/ |
65
|
|
|
public function getCreateDependingRegistrations(): bool |
66
|
|
|
{ |
67
|
|
|
return $this->createDependingRegistrations; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @param bool $createDependingRegistrations |
72
|
|
|
*/ |
73
|
|
|
public function setCreateDependingRegistrations(bool $createDependingRegistrations): void |
74
|
|
|
{ |
75
|
|
|
$this->createDependingRegistrations = $createDependingRegistrations; |
76
|
|
|
} |
77
|
|
|
} |
78
|
|
|
|