Completed
Push — development ( 1e8d3e...a97a1c )
by Torben
04:15 queued 25s
created

ModifyEventQueryConstraintsEvent   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 74
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A getConstraints() 0 4 1
A getQuery() 0 4 1
A getEventDemand() 0 4 1
A getEventRepository() 0 4 1
A setConstraints() 0 4 1
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