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\Dto\EventDemand; |
15
|
|
|
use DERHANSEN\SfEventMgt\Domain\Repository\EventRepository; |
16
|
|
|
use TYPO3\CMS\Extbase\Persistence\QueryInterface; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* This event is triggered before findDemanded in EventRepository is executed |
20
|
|
|
*/ |
21
|
|
|
final class ModifyEventQueryConstraintsEvent |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* @var array |
25
|
|
|
*/ |
26
|
|
|
private $constraints; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var QueryInterface |
30
|
|
|
*/ |
31
|
|
|
private $query; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var EventDemand |
35
|
|
|
*/ |
36
|
|
|
private $eventDemand; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var EventRepository |
40
|
|
|
*/ |
41
|
|
|
private $eventRepository; |
42
|
|
|
|
43
|
|
|
public function __construct( |
44
|
|
|
array $constraints, |
45
|
|
|
QueryInterface $query, |
46
|
|
|
EventDemand $eventDemand, |
47
|
|
|
EventRepository $eventRepository |
48
|
|
|
) { |
49
|
|
|
$this->constraints = $constraints; |
50
|
|
|
$this->query = $query; |
51
|
|
|
$this->eventDemand = $eventDemand; |
52
|
|
|
$this->eventRepository = $eventRepository; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @return array |
57
|
|
|
*/ |
58
|
|
|
public function getConstraints(): array |
59
|
|
|
{ |
60
|
|
|
return $this->constraints; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @return QueryInterface |
65
|
|
|
*/ |
66
|
|
|
public function getQuery(): QueryInterface |
67
|
|
|
{ |
68
|
|
|
return $this->query; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @return EventDemand |
73
|
|
|
*/ |
74
|
|
|
public function getEventDemand(): EventDemand |
75
|
|
|
{ |
76
|
|
|
return $this->eventDemand; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @return EventRepository |
81
|
|
|
*/ |
82
|
|
|
public function getEventRepository(): EventRepository |
83
|
|
|
{ |
84
|
|
|
return $this->eventRepository; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @param array $constraints |
89
|
|
|
*/ |
90
|
|
|
public function setConstraints(array $constraints): void |
91
|
|
|
{ |
92
|
|
|
$this->constraints = $constraints; |
93
|
|
|
} |
94
|
|
|
} |
95
|
|
|
|