|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare( strict_types = 1 ); |
|
4
|
|
|
|
|
5
|
|
|
namespace WMDE\Fundraising\AddressChange\UseCases\ChangeAddress; |
|
6
|
|
|
|
|
7
|
|
|
use WMDE\FreezableValueObject\FreezableValueObject; |
|
8
|
|
|
use WMDE\Fundraising\AddressChange\Domain\Model\AddressChange; |
|
9
|
|
|
|
|
10
|
|
|
class ChangeAddressRequest { |
|
11
|
|
|
use FreezableValueObject; |
|
12
|
|
|
|
|
13
|
|
|
private $salutation; |
|
14
|
|
|
|
|
15
|
|
|
private $company; |
|
16
|
|
|
|
|
17
|
|
|
private $title; |
|
18
|
|
|
|
|
19
|
|
|
private $firstName; |
|
20
|
|
|
|
|
21
|
|
|
private $lastName; |
|
22
|
|
|
|
|
23
|
|
|
private $address; |
|
24
|
|
|
|
|
25
|
|
|
private $postcode; |
|
26
|
|
|
|
|
27
|
|
|
private $city; |
|
28
|
|
|
|
|
29
|
|
|
private $country; |
|
30
|
|
|
|
|
31
|
|
|
private $addressType; |
|
32
|
|
|
|
|
33
|
|
|
private $identifier; |
|
34
|
|
|
|
|
35
|
|
|
private $donationReceipt; |
|
36
|
|
|
|
|
37
|
|
|
private $isOptOutOnly; |
|
38
|
|
|
|
|
39
|
|
|
public function getSalutation(): string { |
|
40
|
|
|
return $this->salutation; |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
public function setSalutation( string $salutation ): self { |
|
44
|
|
|
$this->assertIsWritable(); |
|
45
|
|
|
$this->salutation = $salutation; |
|
46
|
|
|
return $this; |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
public function getCompany(): string { |
|
50
|
|
|
return $this->company; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
public function setCompany( string $company ): self { |
|
54
|
|
|
$this->assertIsWritable(); |
|
55
|
|
|
$this->company = $company; |
|
56
|
|
|
return $this; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
public function getTitle(): string { |
|
60
|
|
|
return $this->title; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
public function setTitle( string $title ): self { |
|
64
|
|
|
$this->assertIsWritable(); |
|
65
|
|
|
$this->title = $title; |
|
66
|
|
|
return $this; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
public function getFirstName(): string { |
|
70
|
|
|
return $this->firstName; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
public function setFirstName( string $firstName ): self { |
|
74
|
|
|
$this->assertIsWritable(); |
|
75
|
|
|
$this->firstName = $firstName; |
|
76
|
|
|
return $this; |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
public function getLastName(): string { |
|
80
|
|
|
return $this->lastName; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
public function setLastName( string $lastName ): self { |
|
84
|
|
|
$this->assertIsWritable(); |
|
85
|
|
|
$this->lastName = $lastName; |
|
86
|
|
|
return $this; |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
public function getAddress(): string { |
|
90
|
|
|
return $this->address; |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
public function setAddress( string $address ): self { |
|
94
|
|
|
$this->assertIsWritable(); |
|
95
|
|
|
$this->address = $address; |
|
96
|
|
|
return $this; |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
public function getPostcode(): string { |
|
100
|
|
|
return $this->postcode; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
public function setPostcode( string $postcode ): self { |
|
104
|
|
|
$this->assertIsWritable(); |
|
105
|
|
|
$this->postcode = $postcode; |
|
106
|
|
|
return $this; |
|
107
|
|
|
} |
|
108
|
|
|
|
|
109
|
|
|
public function getCity(): string { |
|
110
|
|
|
return $this->city; |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
public function setCity( string $city ): self { |
|
114
|
|
|
$this->assertIsWritable(); |
|
115
|
|
|
$this->city = $city; |
|
116
|
|
|
return $this; |
|
117
|
|
|
} |
|
118
|
|
|
|
|
119
|
|
|
public function getCountry(): string { |
|
120
|
|
|
return $this->country; |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
public function setCountry( string $country ): self { |
|
124
|
|
|
$this->assertIsWritable(); |
|
125
|
|
|
$this->country = $country; |
|
126
|
|
|
return $this; |
|
127
|
|
|
} |
|
128
|
|
|
|
|
129
|
|
|
public function getAddressType(): string { |
|
130
|
|
|
return $this->addressType; |
|
131
|
|
|
} |
|
132
|
|
|
|
|
133
|
|
|
public function isPersonal(): bool { |
|
134
|
|
|
return $this->addressType === AddressChange::ADDRESS_TYPE_PERSON; |
|
135
|
|
|
} |
|
136
|
|
|
|
|
137
|
|
|
public function isCompany(): bool { |
|
138
|
|
|
return $this->addressType === AddressChange::ADDRESS_TYPE_COMPANY; |
|
139
|
|
|
} |
|
140
|
|
|
|
|
141
|
|
|
public function setAddressType( string $addressType ): self { |
|
142
|
|
|
$this->assertIsWritable(); |
|
143
|
|
|
$this->addressType = $addressType; |
|
144
|
|
|
return $this; |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
public function getIdentifier(): string { |
|
148
|
|
|
return $this->identifier; |
|
149
|
|
|
} |
|
150
|
|
|
|
|
151
|
|
|
public function setIdentifier( string $identifier ): self { |
|
152
|
|
|
$this->assertIsWritable(); |
|
153
|
|
|
$this->identifier = $identifier; |
|
154
|
|
|
return $this; |
|
155
|
|
|
} |
|
156
|
|
|
|
|
157
|
|
|
public function isOptedIntoDonationReceipt(): bool { |
|
158
|
|
|
return $this->donationReceipt; |
|
159
|
|
|
} |
|
160
|
|
|
|
|
161
|
|
|
public function setDonationReceipt( bool $donationReceipt ): self { |
|
162
|
|
|
$this->assertIsWritable(); |
|
163
|
|
|
$this->donationReceipt = $donationReceipt; |
|
164
|
|
|
return $this; |
|
165
|
|
|
} |
|
166
|
|
|
|
|
167
|
|
|
public function setIsOptOutOnly( bool $isOptOutOnly ): self { |
|
168
|
|
|
$this->assertIsWritable(); |
|
169
|
|
|
$this->isOptOutOnly = $isOptOutOnly; |
|
170
|
|
|
return $this; |
|
171
|
|
|
} |
|
172
|
|
|
|
|
173
|
|
|
public function isOnlyOptInDonationReceiptRequest(): bool { |
|
174
|
|
|
return $this->isOptOutOnly; |
|
175
|
|
|
} |
|
176
|
|
|
|
|
177
|
|
|
} |