Completed
Push — master ( 996d66...c95bf7 )
by Jeroen De
58:45
created

AddDonationRequest::setDonorStreetAddress()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\Fundraising\Frontend\DonationContext\UseCases\AddDonation;
6
7
use WMDE\Euro\Euro;
8
use WMDE\Fundraising\Frontend\DonationContext\Domain\Model\DonorName;
9
use WMDE\Fundraising\Frontend\PaymentContext\Domain\Model\BankData;
10
11
/**
12
 * @license GNU GPL v2+
13
 * @author Kai Nissen < [email protected] >
14
 * @author Jeroen De Dauw < [email protected] >
15
 */
16
class AddDonationRequest {
17
18
	private $donorType;
19
	private $donorFirstName;
20
	private $donorLastName;
21
	private $donorSalutation;
22
	private $donorTitle;
23
	private $donorCompany;
24
	private $donorStreetAddress;
25
	private $donorPostalCode;
26
	private $donorCity;
27
	private $donorCountryCode;
28
	private $donorEmailAddress;
29
30
	private $optIn = '';
31
32
	# donation
33
	private $amount;
34
	private $paymentType = '';
35
	private $interval = 0;
36
37
	# direct debit related
38
	private $bankData;
39
40
	# tracking
41
	private $tracking = '';
42
	private $source = ''; # TODO: generated from referer
43
	private $totalImpressionCount = 0;
44
	private $singleBannerImpressionCount = 0;
45
	// Legacy values, will be deprecated in the future
46
	private $color = '';
47
	private $skin = '';
48
	private $layout = '';
49
50
	public function getOptIn(): string {
51
		return $this->optIn;
52
	}
53
54
	public function setOptIn( string $optIn ) {
55
		$this->optIn = $optIn;
56
	}
57
58
	public function getAmount(): Euro {
59
		return $this->amount;
60
	}
61
62
	public function setAmount( Euro $amount ) {
63
		$this->amount = $amount;
64
	}
65
66
	public function getPaymentType(): string {
67
		return $this->paymentType;
68
	}
69
70
	public function setPaymentType( string $paymentType ) {
71
		$this->paymentType = $paymentType;
72
	}
73
74
	public function getInterval(): int {
75
		return $this->interval;
76
	}
77
78
	public function setInterval( int $interval ) {
79
		$this->interval = $interval;
80
	}
81
82
	/**
83
	 * @return BankData|null
84
	 */
85
	public function getBankData() {
86
		return $this->bankData;
87
	}
88
89
	public function setBankData( BankData $bankData ) {
90
		$this->bankData = $bankData;
91
	}
92
93
	public function getTracking(): string {
94
		return $this->tracking;
95
	}
96
97
	public function setTracking( string $tracking ) {
98
		$this->tracking = $tracking;
99
	}
100
101
	public function getSource(): string {
102
		return $this->source;
103
	}
104
105
	public function setSource( string $source ) {
106
		$this->source = $source;
107
	}
108
109
	public function getTotalImpressionCount(): int {
110
		return $this->totalImpressionCount;
111
	}
112
113
	public function setTotalImpressionCount( int $totalImpressionCount ) {
114
		$this->totalImpressionCount = $totalImpressionCount;
115
	}
116
117
	public function getSingleBannerImpressionCount(): int {
118
		return $this->singleBannerImpressionCount;
119
	}
120
121
	public function setSingleBannerImpressionCount( int $singleBannerImpressionCount ) {
122
		$this->singleBannerImpressionCount = $singleBannerImpressionCount;
123
	}
124
125
	/*
126
	 * @deprecated
127
	 */
128
	public function getColor(): string {
129
		return $this->color;
130
	}
131
132
	/*
133
	 * @deprecated
134
	 */
135
	public function getSkin(): string {
136
		return $this->skin;
137
	}
138
139
	/*
140
	 * @deprecated
141
	 */
142
	public function getLayout(): string {
143
		return $this->layout;
144
	}
145
146
	public function getDonorType(): string {
147
		return $this->donorType;
148
	}
149
150
	public function setDonorType( string $donorType ) {
151
		$this->donorType = $donorType;
152
	}
153
154
	public function getDonorFirstName(): string {
155
		return $this->donorFirstName;
156
	}
157
158
	public function setDonorFirstName( string $donorFirstName ) {
159
		$this->donorFirstName = $donorFirstName;
160
	}
161
162
	public function getDonorLastName(): string {
163
		return $this->donorLastName;
164
	}
165
166
	public function setDonorLastName( string $donorLastName ) {
167
		$this->donorLastName = $donorLastName;
168
	}
169
170
	public function getDonorSalutation(): string {
171
		return $this->donorSalutation;
172
	}
173
174
	public function setDonorSalutation( string $donorSalutation ) {
175
		$this->donorSalutation = $donorSalutation;
176
	}
177
178
	public function getDonorTitle(): string {
179
		return $this->donorTitle;
180
	}
181
182
	public function setDonorTitle( string $donorTitle ) {
183
		$this->donorTitle = $donorTitle;
184
	}
185
186
	public function getDonorCompany(): string {
187
		return $this->donorCompany;
188
	}
189
190
	public function setDonorCompany( string $donorCompany ) {
191
		$this->donorCompany = $donorCompany;
192
	}
193
194
	public function getDonorStreetAddress(): string {
195
		return $this->donorStreetAddress;
196
	}
197
198
	public function setDonorStreetAddress( string $donorStreetAddress ) {
199
		$this->donorStreetAddress = $donorStreetAddress;
200
	}
201
202
	public function getDonorPostalCode(): string {
203
		return $this->donorPostalCode;
204
	}
205
206
	public function setDonorPostalCode( string $donorPostalCode ) {
207
		$this->donorPostalCode = $donorPostalCode;
208
	}
209
210
	public function getDonorCity(): string {
211
		return $this->donorCity;
212
	}
213
214
	public function setDonorCity( string $donorCity ) {
215
		$this->donorCity = $donorCity;
216
	}
217
218
	public function getDonorCountryCode(): string {
219
		return $this->donorCountryCode;
220
	}
221
222
	public function setDonorCountryCode( string $donorCountryCode ) {
223
		$this->donorCountryCode = $donorCountryCode;
224
	}
225
226
	public function getDonorEmailAddress(): string {
227
		return $this->donorEmailAddress;
228
	}
229
230
	public function setDonorEmailAddress( string $donorEmailAddress ) {
231
		$this->donorEmailAddress = $donorEmailAddress;
232
	}
233
234
	public function donorIsAnonymous(): bool {
235
		return $this->getDonorType() === DonorName::PERSON_ANONYMOUS;
236
	}
237
238
	public function donorIsCompany(): bool {
239
		return $this->getDonorType() === DonorName::PERSON_COMPANY;
240
	}
241
}