1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace HDNET\Calendarize\Event; |
6
|
|
|
|
7
|
|
|
use TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface; |
8
|
|
|
use TYPO3\CMS\Extbase\Persistence\QueryInterface; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* This event contains the parameters for the creation of the date time constraints and allows |
12
|
|
|
* the modification of the start and end. |
13
|
|
|
*/ |
14
|
|
|
final class AddTimeFrameConstraintsEvent |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* @var ConstraintInterface[] |
18
|
|
|
*/ |
19
|
|
|
private $constraints; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @var QueryInterface |
23
|
|
|
*/ |
24
|
|
|
private $query; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var array |
28
|
|
|
*/ |
29
|
|
|
private $additionalArguments; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @var \DateTimeInterface|null |
33
|
|
|
*/ |
34
|
|
|
private $start; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var \DateTimeInterface|null |
38
|
|
|
*/ |
39
|
|
|
private $end; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* AddTimeFrameConstraintsEvent constructor. |
43
|
|
|
* |
44
|
|
|
* @param ConstraintInterface[] $constraints |
45
|
|
|
* @param QueryInterface $query |
46
|
|
|
* @param array $additionalArguments |
47
|
|
|
* @param \DateTimeInterface|null $start |
48
|
|
|
* @param \DateTimeInterface|null $end |
49
|
|
|
*/ |
50
|
|
|
public function __construct( |
51
|
|
|
array &$constraints, |
52
|
|
|
QueryInterface $query, |
53
|
|
|
array $additionalArguments, |
54
|
|
|
?\DateTimeInterface $start, |
55
|
|
|
?\DateTimeInterface $end |
56
|
|
|
) { |
57
|
|
|
$this->constraints = &$constraints; |
58
|
|
|
$this->query = $query; |
59
|
|
|
$this->additionalArguments = $additionalArguments; |
60
|
|
|
$this->start = $start; |
61
|
|
|
$this->end = $end; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @return ConstraintInterface[] |
66
|
|
|
*/ |
67
|
|
|
public function &getConstraints(): array |
68
|
|
|
{ |
69
|
|
|
return $this->constraints; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @return QueryInterface |
74
|
|
|
*/ |
75
|
|
|
public function getQuery(): QueryInterface |
76
|
|
|
{ |
77
|
|
|
return $this->query; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @return array |
82
|
|
|
*/ |
83
|
|
|
public function getAdditionalArguments(): array |
84
|
|
|
{ |
85
|
|
|
return $this->additionalArguments; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @return \DateTimeInterface|null |
90
|
|
|
*/ |
91
|
|
|
public function getStart(): ?\DateTimeInterface |
92
|
|
|
{ |
93
|
|
|
return $this->start; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @return \DateTimeInterface|null |
98
|
|
|
*/ |
99
|
|
|
public function getEnd(): ?\DateTimeInterface |
100
|
|
|
{ |
101
|
|
|
return $this->end; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @param \DateTimeInterface|null $start |
106
|
|
|
*/ |
107
|
|
|
public function setStart(?\DateTimeInterface $start): void |
108
|
|
|
{ |
109
|
|
|
$this->start = $start; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @param \DateTimeInterface|null $end |
114
|
|
|
*/ |
115
|
|
|
public function setEnd(?\DateTimeInterface $end): void |
116
|
|
|
{ |
117
|
|
|
$this->end = $end; |
118
|
|
|
} |
119
|
|
|
} |
120
|
|
|
|