Completed
Push — master ( 70dfe1...a97a1c )
by Torben
04:18
created

ProcessPaymentCancelEvent::setRemoveRegistration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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\Controller\PaymentController;
15
use DERHANSEN\SfEventMgt\Domain\Model\Registration;
16
17
/**
18
 * This event is triggered before the payment cancel view is rendered. This event must be used to handle the
19
 * registration (e.g. update/delete) in case of the payment process is cancelled.
20
 */
21
final class ProcessPaymentCancelEvent
22
{
23
    /**
24
     * @var array
25
     */
26
    private $variables;
27
28
    /**
29
     * @var string
30
     */
31
    private $paymentMethod;
32
33
    /**
34
     * @var bool
35
     */
36
    private $updateRegistration;
37
38
    /**
39
     * @var bool
40
     */
41
    private $removeRegistration;
42
43
    /**
44
     * @var Registration
45
     */
46
    private $registration;
47
48
    /**
49
     * @var array
50
     */
51
    private $getVariables;
52
53
    /**
54
     * @var PaymentController
55
     */
56
    private $paymentController;
57
58
    public function __construct(
59
        array $variables,
60
        string $paymentMethod,
61
        bool $updateRegistration,
62
        bool $removeRegistration,
63
        Registration $registration,
64
        array $getVariables,
65
        PaymentController $paymentController
66
    ) {
67
        $this->variables = $variables;
68
        $this->paymentMethod = $paymentMethod;
69
        $this->updateRegistration = $updateRegistration;
70
        $this->removeRegistration = $removeRegistration;
71
        $this->registration = $registration;
72
        $this->getVariables = $getVariables;
73
        $this->paymentController = $paymentController;
74
    }
75
76
    /**
77
     * @return array
78
     */
79
    public function getVariables(): array
80
    {
81
        return $this->variables;
82
    }
83
84
    /**
85
     * @return string
86
     */
87
    public function getPaymentMethod(): string
88
    {
89
        return $this->paymentMethod;
90
    }
91
92
    /**
93
     * @return bool
94
     */
95
    public function getUpdateRegistration(): bool
96
    {
97
        return $this->updateRegistration;
98
    }
99
100
    /**
101
     * @return bool
102
     */
103
    public function getRemoveRegistration(): bool
104
    {
105
        return $this->removeRegistration;
106
    }
107
108
    /**
109
     * @return Registration
110
     */
111
    public function getRegistration(): Registration
112
    {
113
        return $this->registration;
114
    }
115
116
    /**
117
     * @return array
118
     */
119
    public function getGetVariables(): array
120
    {
121
        return $this->getVariables;
122
    }
123
124
    /**
125
     * @return PaymentController
126
     */
127
    public function getPaymentController(): PaymentController
128
    {
129
        return $this->paymentController;
130
    }
131
132
    /**
133
     * @param array $variables
134
     */
135
    public function setVariables(array $variables): void
136
    {
137
        $this->variables = $variables;
138
    }
139
140
    /**
141
     * @param bool $updateRegistration
142
     */
143
    public function setUpdateRegistration(bool $updateRegistration): void
144
    {
145
        $this->updateRegistration = $updateRegistration;
146
    }
147
148
    /**
149
     * @param bool $removeRegistration
150
     */
151
    public function setRemoveRegistration(bool $removeRegistration): void
152
    {
153
        $this->removeRegistration = $removeRegistration;
154
    }
155
}
156