|
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\Domain\Model\Registration; |
|
13
|
|
|
use DERHANSEN\SfEventMgt\Service\NotificationService; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* This event should be used to modify the attachments of a user message. Use the $type variable to distinguish |
|
17
|
|
|
* between the different types of messages |
|
18
|
|
|
*/ |
|
19
|
|
|
final class ModifyUserMessageAttachmentsEvent |
|
20
|
|
|
{ |
|
21
|
|
|
/** |
|
22
|
|
|
* @var array |
|
23
|
|
|
*/ |
|
24
|
|
|
private $attachments; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* @var Registration |
|
28
|
|
|
*/ |
|
29
|
|
|
private $registration; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @var int |
|
33
|
|
|
*/ |
|
34
|
|
|
private $type; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @var NotificationService |
|
38
|
|
|
*/ |
|
39
|
|
|
private $notificationService; |
|
40
|
|
|
|
|
41
|
|
|
public function __construct( |
|
42
|
|
|
array $attachments, |
|
43
|
|
|
Registration $registration, |
|
44
|
|
|
int $type, |
|
45
|
|
|
NotificationService $notificationService |
|
46
|
|
|
) { |
|
47
|
|
|
$this->attachments = $attachments; |
|
48
|
|
|
$this->registration = $registration; |
|
49
|
|
|
$this->type = $type; |
|
50
|
|
|
$this->notificationService = $notificationService; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @return array |
|
55
|
|
|
*/ |
|
56
|
|
|
public function getAttachments(): array |
|
57
|
|
|
{ |
|
58
|
|
|
return $this->attachments; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* @return Registration |
|
63
|
|
|
*/ |
|
64
|
|
|
public function getRegistration(): Registration |
|
65
|
|
|
{ |
|
66
|
|
|
return $this->registration; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* @return int |
|
71
|
|
|
*/ |
|
72
|
|
|
public function getType(): int |
|
73
|
|
|
{ |
|
74
|
|
|
return $this->type; |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* @return NotificationService |
|
79
|
|
|
*/ |
|
80
|
|
|
public function getNotificationService(): NotificationService |
|
81
|
|
|
{ |
|
82
|
|
|
return $this->notificationService; |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* @param array $attachments |
|
87
|
|
|
*/ |
|
88
|
|
|
public function setAttachments(array $attachments): void |
|
89
|
|
|
{ |
|
90
|
|
|
$this->attachments = $attachments; |
|
91
|
|
|
} |
|
92
|
|
|
} |
|
93
|
|
|
|