Completed
Push — typo3-10-compatibility ( b4f2e1...42d8ec )
by Torben
03:17
created

ModifyEventQueryConstraintsEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

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