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