1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace WMDE\Fundraising\Entities; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use Gedmo\Mapping\Annotation as Gedmo; |
7
|
|
|
use WMDE\Fundraising\Store\MembershipApplicationData; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* @since 2.0 |
11
|
|
|
* |
12
|
|
|
* @ORM\Table(name="request", indexes={@ORM\Index(name="idx_donation_id", columns={"donation_id"})}) |
13
|
|
|
* @ORM\Entity |
14
|
|
|
*/ |
15
|
|
|
class MembershipApplication { |
16
|
|
|
|
17
|
|
|
const STATUS_CONFIRMED = 1; |
18
|
|
|
const STATUS_NEUTRAL = 0; |
19
|
|
|
const STATUS_DELETED = -1; |
20
|
|
|
const STATUS_MODERATION = -2; |
21
|
|
|
const STATUS_ABORTED = -4; |
22
|
|
|
const STATUS_CANCELED = -8; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var integer |
26
|
|
|
* |
27
|
|
|
* @ORM\Column(name="id", type="integer") |
28
|
|
|
* @ORM\Id |
29
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
30
|
|
|
*/ |
31
|
|
|
private $id; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* FIXME: this should not be nullable |
35
|
|
|
* |
36
|
|
|
* @var integer |
37
|
|
|
* |
38
|
|
|
* @ORM\Column(name="status", type="smallint", options={"default":0}, nullable=true) |
39
|
|
|
*/ |
40
|
|
|
private $status = 0; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var integer|null |
44
|
|
|
* |
45
|
|
|
* @ORM\Column(name="donation_id", type="integer", nullable=true) |
46
|
|
|
*/ |
47
|
|
|
private $donationId; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @var \DateTime |
51
|
|
|
* |
52
|
|
|
* @Gedmo\Timestampable(on="create") |
53
|
|
|
* @ORM\Column(name="timestamp", type="datetime") |
54
|
|
|
*/ |
55
|
|
|
private $creationTime; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var string|null |
59
|
|
|
* |
60
|
|
|
* @ORM\Column(name="anrede", type="string", length=16, nullable=true) |
61
|
|
|
*/ |
62
|
|
|
private $applicantSalutation; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @var string|null |
66
|
|
|
* |
67
|
|
|
* @ORM\Column(name="firma", type="string", length=100, nullable=true) |
68
|
|
|
*/ |
69
|
|
|
private $company; |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @var string|null |
73
|
|
|
* |
74
|
|
|
* @ORM\Column(name="titel", type="string", length=16, nullable=true) |
75
|
|
|
*/ |
76
|
|
|
private $applicantTitle; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @var string |
80
|
|
|
* |
81
|
|
|
* @ORM\Column(name="name", type="string", length=250, options={"default":""}, nullable=false) |
82
|
|
|
*/ |
83
|
|
|
private $probablyUnusedNameField = ''; |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* @var string |
87
|
|
|
* |
88
|
|
|
* @ORM\Column(name="vorname", type="string", length=50, options={"default":""}, nullable=false) |
89
|
|
|
*/ |
90
|
|
|
private $applicantFirstName = ''; |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @var string |
94
|
|
|
* |
95
|
|
|
* @ORM\Column(name="nachname", type="string", length=50, options={"default":""}, nullable=false) |
96
|
|
|
*/ |
97
|
|
|
private $applicantLastName = ''; |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @var string|null |
101
|
|
|
* |
102
|
|
|
* @ORM\Column(name="strasse", type="string", length=100, nullable=true) |
103
|
|
|
*/ |
104
|
|
|
private $address; |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @var string|null |
108
|
|
|
* |
109
|
|
|
* @ORM\Column(name="plz", type="string", length=8, nullable=true) |
110
|
|
|
*/ |
111
|
|
|
private $postcode; |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* @var string|null |
115
|
|
|
* |
116
|
|
|
* @ORM\Column(name="ort", type="string", length=100, nullable=true) |
117
|
|
|
*/ |
118
|
|
|
private $city; |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* @var string|null |
122
|
|
|
* |
123
|
|
|
* @ORM\Column(name="country", type="string", length=8, options={"default":""}, nullable=true) |
124
|
|
|
*/ |
125
|
|
|
private $country = ''; |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @var string |
129
|
|
|
* |
130
|
|
|
* @ORM\Column(name="email", type="string", length=250, options={"default":""}, nullable=false) |
131
|
|
|
*/ |
132
|
|
|
private $applicantEmailAddress = ''; |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @var string |
136
|
|
|
* |
137
|
|
|
* @ORM\Column(name="phone", type="string", length=30, options={"default":""}, nullable=false) |
138
|
|
|
*/ |
139
|
|
|
private $applicantPhoneNumber = ''; |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* Date of birth |
143
|
|
|
* |
144
|
|
|
* @var \DateTime|null |
145
|
|
|
* |
146
|
|
|
* @ORM\Column(name="dob", type="date", nullable=true) |
147
|
|
|
*/ |
148
|
|
|
private $applicantDateOfBirth; |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* @var string |
152
|
|
|
* |
153
|
|
|
* @ORM\Column(name="wikimedium_shipping", type="string", options={"default":""}, nullable=false) |
154
|
|
|
*/ |
155
|
|
|
private $wikimediumShipping = 'none'; |
156
|
|
|
|
157
|
|
|
/** |
158
|
|
|
* @var string |
159
|
|
|
* |
160
|
|
|
* @ORM\Column(name="membership_type", type="string", options={"default":"sustaining"}, nullable=false) |
161
|
|
|
*/ |
162
|
|
|
private $membershipType = 'sustaining'; |
163
|
|
|
|
164
|
|
|
/** |
165
|
|
|
* @var string |
166
|
|
|
* |
167
|
|
|
* @ORM\Column(name="payment_type", type="string", options={"default":"BEZ"}, nullable=false) |
168
|
|
|
*/ |
169
|
|
|
private $paymentType = 'BEZ'; |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* @var integer |
173
|
|
|
* |
174
|
|
|
* @ORM\Column(name="membership_fee", type="integer", options={"default":0}, nullable=false) |
175
|
|
|
*/ |
176
|
|
|
private $paymentAmountInEuro = 0; |
177
|
|
|
|
178
|
|
|
/** |
179
|
|
|
* FIXME: this should not be nullable |
180
|
|
|
* |
181
|
|
|
* @var integer |
182
|
|
|
* |
183
|
|
|
* @ORM\Column(name="membership_fee_interval", type="smallint", options={"default":12}, nullable=true) |
184
|
|
|
*/ |
185
|
|
|
private $paymentIntervalInMonths = 12; |
186
|
|
|
|
187
|
|
|
/** |
188
|
|
|
* @var string |
189
|
|
|
* |
190
|
|
|
* @ORM\Column(name="account_number", type="string", length=16, options={"default":""}, nullable=false) |
191
|
|
|
*/ |
192
|
|
|
private $paymentBankAccount = ''; |
193
|
|
|
|
194
|
|
|
/** |
195
|
|
|
* @var string |
196
|
|
|
* |
197
|
|
|
* @ORM\Column(name="bank_name", type="string", length=50, options={"default":""}, nullable=false) |
198
|
|
|
*/ |
199
|
|
|
private $paymentBankName = ''; |
200
|
|
|
|
201
|
|
|
/** |
202
|
|
|
* @var string |
203
|
|
|
* |
204
|
|
|
* @ORM\Column(name="bank_code", type="string", length=16, options={"default":""}, nullable=false) |
205
|
|
|
*/ |
206
|
|
|
private $paymentBankCode = ''; |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* @var string|null |
210
|
|
|
* |
211
|
|
|
* @ORM\Column(name="iban", type="string", length=32, options={"default":""}, nullable=true) |
212
|
|
|
*/ |
213
|
|
|
private $paymentIban = ''; |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* @var string|null |
217
|
|
|
* |
218
|
|
|
* @ORM\Column(name="bic", type="string", length=32, options={"default":""}, nullable=true) |
219
|
|
|
*/ |
220
|
|
|
private $paymentBic = ''; |
221
|
|
|
|
222
|
|
|
/** |
223
|
|
|
* @var string |
224
|
|
|
* |
225
|
|
|
* @ORM\Column(name="account_holder", type="string", length=50, options={"default":""}, nullable=false) |
226
|
|
|
*/ |
227
|
|
|
private $paymentBankAccountHolder = ''; |
228
|
|
|
|
229
|
|
|
/** |
230
|
|
|
* @var string |
231
|
|
|
* |
232
|
|
|
* @ORM\Column(name="comment", type="text", options={"default":""}, nullable=false) |
233
|
|
|
*/ |
234
|
|
|
private $comment = ''; |
235
|
|
|
|
236
|
|
|
/** |
237
|
|
|
* @var \DateTime|null |
238
|
|
|
* |
239
|
|
|
* @ORM\Column(name="export", type="datetime", nullable=true) |
240
|
|
|
*/ |
241
|
|
|
private $export; |
242
|
|
|
|
243
|
|
|
/** |
244
|
|
|
* @var \DateTime|null |
245
|
|
|
* |
246
|
|
|
* @ORM\Column(name="backup", type="datetime", nullable=true) |
247
|
|
|
*/ |
248
|
|
|
private $backup; |
249
|
|
|
|
250
|
|
|
/** |
251
|
|
|
* @var boolean |
252
|
|
|
* |
253
|
|
|
* @ORM\Column(name="wikilogin", type="boolean", options={"default":0}, nullable=false) |
254
|
|
|
*/ |
255
|
|
|
private $wikilogin = 0; |
256
|
|
|
|
257
|
|
|
/** |
258
|
|
|
* @var string|null |
259
|
|
|
* |
260
|
|
|
* @ORM\Column(name="tracking", type="string", length=50, nullable=true) |
261
|
|
|
*/ |
262
|
|
|
private $tracking; |
263
|
|
|
|
264
|
|
|
/** |
265
|
|
|
* @var string|null |
266
|
|
|
* |
267
|
|
|
* @ORM\Column(name="data", type="text", nullable=true) |
268
|
|
|
*/ |
269
|
|
|
private $data; |
270
|
|
|
|
271
|
|
|
/** |
272
|
|
|
* @return integer |
273
|
|
|
*/ |
274
|
3 |
|
public function getId() { |
275
|
3 |
|
return $this->id; |
276
|
|
|
} |
277
|
|
|
|
278
|
|
|
/** |
279
|
|
|
* @since 2.0 |
280
|
|
|
* |
281
|
|
|
* @param integer|null $id |
282
|
|
|
*/ |
283
|
2 |
|
public function setId( $id ) { |
284
|
2 |
|
$this->id = $id; |
285
|
2 |
|
} |
286
|
|
|
|
287
|
|
|
/** |
288
|
|
|
* @param integer|null $donationId |
289
|
|
|
* |
290
|
|
|
* @return self |
291
|
|
|
*/ |
292
|
|
|
public function setDonationId( $donationId ) { |
293
|
|
|
$this->donationId = $donationId; |
294
|
|
|
|
295
|
|
|
return $this; |
296
|
|
|
} |
297
|
|
|
|
298
|
|
|
/** |
299
|
|
|
* Returns the id of the donation that led to the membership application, |
300
|
|
|
* or null when the application is not linked to any donation. |
301
|
|
|
* |
302
|
|
|
* @return integer|null |
303
|
|
|
*/ |
304
|
|
|
public function getDonationId() { |
305
|
|
|
return $this->donationId; |
306
|
|
|
} |
307
|
|
|
|
308
|
|
|
/** |
309
|
|
|
* @param \DateTime|null $creationTime |
310
|
|
|
* |
311
|
|
|
* @return self |
312
|
|
|
*/ |
313
|
|
|
public function setCreationTime( $creationTime ) { |
314
|
|
|
$this->creationTime = $creationTime; |
315
|
|
|
|
316
|
|
|
return $this; |
317
|
|
|
} |
318
|
|
|
|
319
|
|
|
/** |
320
|
|
|
* @return \DateTime|null |
321
|
|
|
*/ |
322
|
|
|
public function getCreationTime() { |
323
|
|
|
return $this->creationTime; |
324
|
|
|
} |
325
|
|
|
|
326
|
|
|
/** |
327
|
|
|
* @param string|null $applicantSalutation |
328
|
|
|
* |
329
|
|
|
* @return self |
330
|
|
|
*/ |
331
|
|
|
public function setApplicantSalutation( $applicantSalutation ) { |
332
|
|
|
$this->applicantSalutation = $applicantSalutation; |
333
|
|
|
|
334
|
|
|
return $this; |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
/** |
338
|
|
|
* @return string|null |
339
|
|
|
*/ |
340
|
|
|
public function getApplicantSalutation() { |
341
|
|
|
return $this->applicantSalutation; |
342
|
|
|
} |
343
|
|
|
|
344
|
|
|
/** |
345
|
|
|
* @param string|null $company |
346
|
|
|
* |
347
|
|
|
* @return self |
348
|
|
|
*/ |
349
|
|
|
public function setCompany( $company ) { |
350
|
|
|
$this->company = $company; |
351
|
|
|
|
352
|
|
|
return $this; |
353
|
|
|
} |
354
|
|
|
|
355
|
|
|
/** |
356
|
|
|
* @return string|null |
357
|
|
|
*/ |
358
|
|
|
public function getCompany() { |
359
|
|
|
return $this->company; |
360
|
|
|
} |
361
|
|
|
|
362
|
|
|
/** |
363
|
|
|
* @param string $applicantTitle |
364
|
|
|
* |
365
|
|
|
* @return self |
366
|
|
|
*/ |
367
|
|
|
public function setApplicantTitle( $applicantTitle ) { |
368
|
|
|
$this->applicantTitle = $applicantTitle; |
369
|
|
|
|
370
|
|
|
return $this; |
371
|
|
|
} |
372
|
|
|
|
373
|
|
|
/** |
374
|
|
|
* @return string |
375
|
|
|
*/ |
376
|
|
|
public function getApplicantTitle() { |
377
|
|
|
return $this->applicantTitle; |
378
|
|
|
} |
379
|
|
|
|
380
|
|
|
/** |
381
|
|
|
* @param string $probablyUnusedNameField |
382
|
|
|
* |
383
|
|
|
* @return self |
384
|
|
|
*/ |
385
|
|
|
public function setProbablyUnusedNameField( $probablyUnusedNameField ) { |
386
|
|
|
$this->probablyUnusedNameField = $probablyUnusedNameField; |
387
|
|
|
|
388
|
|
|
return $this; |
389
|
|
|
} |
390
|
|
|
|
391
|
|
|
/** |
392
|
|
|
* @return string |
393
|
|
|
*/ |
394
|
|
|
public function getProbablyUnusedNameField() { |
395
|
|
|
return $this->probablyUnusedNameField; |
396
|
|
|
} |
397
|
|
|
|
398
|
|
|
/** |
399
|
|
|
* @param string $applicantFirstName |
400
|
|
|
* |
401
|
|
|
* @return self |
402
|
|
|
*/ |
403
|
|
|
public function setApplicantFirstName( $applicantFirstName ) { |
404
|
|
|
$this->applicantFirstName = $applicantFirstName; |
405
|
|
|
$this->setNameFromParts( $applicantFirstName, $this->getApplicantLastName() ); |
406
|
|
|
|
407
|
|
|
return $this; |
408
|
|
|
} |
409
|
|
|
|
410
|
|
|
/** |
411
|
|
|
* @return string |
412
|
|
|
*/ |
413
|
|
|
public function getApplicantFirstName() { |
414
|
|
|
return $this->applicantFirstName; |
415
|
|
|
} |
416
|
|
|
|
417
|
|
|
/** |
418
|
|
|
* @param string $applicantLastName |
419
|
|
|
* |
420
|
|
|
* @return self |
421
|
|
|
*/ |
422
|
|
|
public function setApplicantLastName( $applicantLastName ) { |
423
|
|
|
$this->applicantLastName = $applicantLastName; |
424
|
|
|
$this->setNameFromParts( $this->getApplicantFirstName(), $applicantLastName ); |
425
|
|
|
|
426
|
|
|
return $this; |
427
|
|
|
} |
428
|
|
|
|
429
|
|
|
/** |
430
|
|
|
* @return string |
431
|
|
|
*/ |
432
|
|
|
public function getApplicantLastName() { |
433
|
|
|
return $this->applicantLastName; |
434
|
|
|
} |
435
|
|
|
|
436
|
|
|
/** |
437
|
|
|
* Sets the full name |
438
|
|
|
* |
439
|
|
|
* @param string|null $firstName |
440
|
|
|
* @param string|null $lastName |
441
|
|
|
* |
442
|
|
|
* @return self |
443
|
|
|
*/ |
444
|
|
|
private function setNameFromParts( $firstName, $lastName ) { |
445
|
|
|
$this->setProbablyUnusedNameField( implode( |
446
|
|
|
' ', |
447
|
|
|
array_filter( [ $firstName, $lastName ] ) |
448
|
|
|
) ); |
449
|
|
|
|
450
|
|
|
return $this; |
451
|
|
|
} |
452
|
|
|
|
453
|
|
|
/** |
454
|
|
|
* Set address (street, etc) |
455
|
|
|
* |
456
|
|
|
* @param string|null $address |
457
|
|
|
* |
458
|
|
|
* @return self |
459
|
|
|
*/ |
460
|
|
|
public function setAddress( $address ) { |
461
|
|
|
$this->address = $address; |
462
|
|
|
|
463
|
|
|
return $this; |
464
|
|
|
} |
465
|
|
|
|
466
|
|
|
/** |
467
|
|
|
* Get address (street, etc) |
468
|
|
|
* |
469
|
|
|
* @return string|null |
470
|
|
|
*/ |
471
|
|
|
public function getAddress() { |
472
|
|
|
return $this->address; |
473
|
|
|
} |
474
|
|
|
|
475
|
|
|
/** |
476
|
|
|
* @param string|null $postcode |
477
|
|
|
* |
478
|
|
|
* @return self |
479
|
|
|
*/ |
480
|
|
|
public function setPostcode( $postcode ) { |
481
|
|
|
$this->postcode = $postcode; |
482
|
|
|
|
483
|
|
|
return $this; |
484
|
|
|
} |
485
|
|
|
|
486
|
|
|
/** |
487
|
|
|
* @return string|null |
488
|
|
|
*/ |
489
|
|
|
public function getPostcode() { |
490
|
|
|
return $this->postcode; |
491
|
|
|
} |
492
|
|
|
|
493
|
|
|
/** |
494
|
|
|
* @param string|null $city |
495
|
|
|
* |
496
|
|
|
* @return self |
497
|
|
|
*/ |
498
|
|
|
public function setCity( $city ) { |
499
|
|
|
$this->city = $city; |
500
|
|
|
|
501
|
|
|
return $this; |
502
|
|
|
} |
503
|
|
|
|
504
|
|
|
/** |
505
|
|
|
* @return string|null |
506
|
|
|
*/ |
507
|
|
|
public function getCity() { |
508
|
|
|
return $this->city; |
509
|
|
|
} |
510
|
|
|
|
511
|
|
|
/** |
512
|
|
|
* Set email |
513
|
|
|
* |
514
|
|
|
* @param string $applicantEmailAddress |
515
|
|
|
* |
516
|
|
|
* @return self |
517
|
|
|
*/ |
518
|
|
|
public function setApplicantEmailAddress( $applicantEmailAddress ) { |
519
|
|
|
$this->applicantEmailAddress = $applicantEmailAddress; |
520
|
|
|
|
521
|
|
|
return $this; |
522
|
|
|
} |
523
|
|
|
|
524
|
|
|
/** |
525
|
|
|
* Get email |
526
|
|
|
* |
527
|
|
|
* @return string |
528
|
|
|
*/ |
529
|
|
|
public function getApplicantEmailAddress() { |
530
|
|
|
return $this->applicantEmailAddress; |
531
|
|
|
} |
532
|
|
|
|
533
|
|
|
/** |
534
|
|
|
* Set phone |
535
|
|
|
* |
536
|
|
|
* @param string $applicantPhoneNumber |
537
|
|
|
* |
538
|
|
|
* @return self |
539
|
|
|
*/ |
540
|
|
|
public function setApplicantPhoneNumber( $applicantPhoneNumber ) { |
541
|
|
|
$this->applicantPhoneNumber = $applicantPhoneNumber; |
542
|
|
|
|
543
|
|
|
return $this; |
544
|
|
|
} |
545
|
|
|
|
546
|
|
|
/** |
547
|
|
|
* Get phone |
548
|
|
|
* |
549
|
|
|
* @return string |
550
|
|
|
*/ |
551
|
|
|
public function getApplicantPhoneNumber() { |
552
|
|
|
return $this->applicantPhoneNumber; |
553
|
|
|
} |
554
|
|
|
|
555
|
|
|
/** |
556
|
|
|
* @param \DateTime|null $dateOfBirth |
557
|
|
|
* |
558
|
|
|
* @return self |
559
|
|
|
*/ |
560
|
|
|
public function setApplicantDateOfBirth( $dateOfBirth ) { |
561
|
|
|
$this->applicantDateOfBirth = $dateOfBirth; |
562
|
|
|
|
563
|
|
|
return $this; |
564
|
|
|
} |
565
|
|
|
|
566
|
|
|
/** |
567
|
|
|
* @return \DateTime|null |
568
|
|
|
*/ |
569
|
|
|
public function getApplicantDateOfBirth() { |
570
|
|
|
return $this->applicantDateOfBirth; |
571
|
|
|
} |
572
|
|
|
|
573
|
|
|
/** |
574
|
|
|
* @param string $wikimediumShipping |
575
|
|
|
* |
576
|
|
|
* @return self |
577
|
|
|
*/ |
578
|
|
|
public function setWikimediumShipping( $wikimediumShipping ) { |
579
|
|
|
$this->wikimediumShipping = $wikimediumShipping; |
580
|
|
|
|
581
|
|
|
return $this; |
582
|
|
|
} |
583
|
|
|
|
584
|
|
|
/** |
585
|
|
|
* @return string |
586
|
|
|
*/ |
587
|
|
|
public function getWikimediumShipping() { |
588
|
|
|
return $this->wikimediumShipping; |
589
|
|
|
} |
590
|
|
|
|
591
|
|
|
/** |
592
|
|
|
* @param string $membershipType |
593
|
|
|
* |
594
|
|
|
* @return self |
595
|
|
|
*/ |
596
|
|
|
public function setMembershipType( $membershipType ) { |
597
|
|
|
$this->membershipType = $membershipType; |
598
|
|
|
|
599
|
|
|
return $this; |
600
|
|
|
} |
601
|
|
|
|
602
|
|
|
/** |
603
|
|
|
* @return string |
604
|
|
|
*/ |
605
|
|
|
public function getMembershipType() { |
606
|
|
|
return $this->membershipType; |
607
|
|
|
} |
608
|
|
|
|
609
|
|
|
/** |
610
|
|
|
* @param string $paymentType |
611
|
|
|
* |
612
|
|
|
* @return self |
613
|
|
|
*/ |
614
|
|
|
public function setPaymentType( $paymentType ) { |
615
|
|
|
$this->paymentType = $paymentType; |
616
|
|
|
|
617
|
|
|
return $this; |
618
|
|
|
} |
619
|
|
|
|
620
|
|
|
/** |
621
|
|
|
* @return string |
622
|
|
|
*/ |
623
|
|
|
public function getPaymentType() { |
624
|
|
|
return $this->paymentType; |
625
|
|
|
} |
626
|
|
|
|
627
|
|
|
/** |
628
|
|
|
* @param integer $paymentAmountInEuro |
629
|
|
|
* |
630
|
|
|
* @return self |
631
|
|
|
*/ |
632
|
|
|
public function setPaymentAmount( $paymentAmountInEuro ) { |
633
|
|
|
$this->paymentAmountInEuro = $paymentAmountInEuro; |
634
|
|
|
|
635
|
|
|
return $this; |
636
|
|
|
} |
637
|
|
|
|
638
|
|
|
/** |
639
|
|
|
* @return integer |
640
|
|
|
*/ |
641
|
|
|
public function getPaymentAmount() { |
642
|
|
|
return $this->paymentAmountInEuro; |
643
|
|
|
} |
644
|
|
|
|
645
|
|
|
/** |
646
|
|
|
* @param integer $paymentIntervalInMonths |
647
|
|
|
* |
648
|
|
|
* @return self |
649
|
|
|
*/ |
650
|
|
|
public function setPaymentIntervalInMonths($paymentIntervalInMonths) { |
651
|
|
|
$this->paymentIntervalInMonths = $paymentIntervalInMonths; |
652
|
|
|
|
653
|
|
|
return $this; |
654
|
|
|
} |
655
|
|
|
|
656
|
|
|
/** |
657
|
|
|
* @return integer |
658
|
|
|
*/ |
659
|
|
|
public function getPaymentIntervalInMonths() { |
660
|
|
|
return $this->paymentIntervalInMonths; |
661
|
|
|
} |
662
|
|
|
|
663
|
|
|
|
664
|
|
|
/** |
665
|
|
|
* @param string $paymentBankAccount |
666
|
|
|
* |
667
|
|
|
* @return self |
668
|
|
|
*/ |
669
|
|
|
public function setPaymentBankAccount( $paymentBankAccount ) { |
670
|
|
|
$this->paymentBankAccount = $paymentBankAccount; |
671
|
|
|
|
672
|
|
|
return $this; |
673
|
|
|
} |
674
|
|
|
|
675
|
|
|
/** |
676
|
|
|
* @return string |
677
|
|
|
*/ |
678
|
|
|
public function getPaymentBankAccount() { |
679
|
|
|
return $this->paymentBankAccount; |
680
|
|
|
} |
681
|
|
|
|
682
|
|
|
/** |
683
|
|
|
* @param string $paymentBankName |
684
|
|
|
* |
685
|
|
|
* @return self |
686
|
|
|
*/ |
687
|
|
|
public function setPaymentBankName( $paymentBankName ) { |
688
|
|
|
$this->paymentBankName = $paymentBankName; |
689
|
|
|
|
690
|
|
|
return $this; |
691
|
|
|
} |
692
|
|
|
|
693
|
|
|
/** |
694
|
|
|
* @return string |
695
|
|
|
*/ |
696
|
|
|
public function getPaymentBankName() { |
697
|
|
|
return $this->paymentBankName; |
698
|
|
|
} |
699
|
|
|
|
700
|
|
|
/** |
701
|
|
|
* @param string $paymentBankCode |
702
|
|
|
* |
703
|
|
|
* @return self |
704
|
|
|
*/ |
705
|
|
|
public function setPaymentBankCode( $paymentBankCode ) { |
706
|
|
|
$this->paymentBankCode = $paymentBankCode; |
707
|
|
|
|
708
|
|
|
return $this; |
709
|
|
|
} |
710
|
|
|
|
711
|
|
|
/** |
712
|
|
|
* @return string |
713
|
|
|
*/ |
714
|
|
|
public function getPaymentBankCode() { |
715
|
|
|
return $this->paymentBankCode; |
716
|
|
|
} |
717
|
|
|
|
718
|
|
|
/** |
719
|
|
|
* @param string|null $paymentIban |
720
|
|
|
* |
721
|
|
|
* @return self |
722
|
|
|
*/ |
723
|
|
|
public function setPaymentIban( $paymentIban ) { |
724
|
|
|
$this->paymentIban = $paymentIban; |
725
|
|
|
|
726
|
|
|
return $this; |
727
|
|
|
} |
728
|
|
|
|
729
|
|
|
/** |
730
|
|
|
* @return string|null |
731
|
|
|
*/ |
732
|
|
|
public function getPaymentIban() { |
733
|
|
|
return $this->paymentIban; |
734
|
|
|
} |
735
|
|
|
|
736
|
|
|
/** |
737
|
|
|
* @param string|null $paymentBic |
738
|
|
|
* |
739
|
|
|
* @return self |
740
|
|
|
*/ |
741
|
|
|
public function setPaymentBic( $paymentBic ) { |
742
|
|
|
$this->paymentBic = $paymentBic; |
743
|
|
|
|
744
|
|
|
return $this; |
745
|
|
|
} |
746
|
|
|
|
747
|
|
|
/** |
748
|
|
|
* @return string|null |
749
|
|
|
*/ |
750
|
|
|
public function getPaymentBic() { |
751
|
|
|
return $this->paymentBic; |
752
|
|
|
} |
753
|
|
|
|
754
|
|
|
/** |
755
|
|
|
* @param string $paymentBankAccountHolder |
756
|
|
|
* |
757
|
|
|
* @return self |
758
|
|
|
*/ |
759
|
|
|
public function setPaymentBankAccountHolder( $paymentBankAccountHolder ) { |
760
|
|
|
$this->paymentBankAccountHolder = $paymentBankAccountHolder; |
761
|
|
|
|
762
|
|
|
return $this; |
763
|
|
|
} |
764
|
|
|
|
765
|
|
|
/** |
766
|
|
|
* @return string |
767
|
|
|
*/ |
768
|
|
|
public function getPaymentBankAccountHolder() { |
769
|
|
|
return $this->paymentBankAccountHolder; |
770
|
|
|
} |
771
|
|
|
|
772
|
|
|
/** |
773
|
|
|
* @param string $comment |
774
|
|
|
* |
775
|
|
|
* @return self |
776
|
|
|
*/ |
777
|
|
|
public function setComment( $comment ) { |
778
|
|
|
$this->comment = $comment; |
779
|
|
|
|
780
|
|
|
return $this; |
781
|
|
|
} |
782
|
|
|
|
783
|
|
|
/** |
784
|
|
|
* @return string |
785
|
|
|
*/ |
786
|
|
|
public function getComment() { |
787
|
|
|
return $this->comment; |
788
|
|
|
} |
789
|
|
|
|
790
|
|
|
/** |
791
|
|
|
* Sets the time of export. |
792
|
|
|
* |
793
|
|
|
* @param \DateTime|null $export |
794
|
|
|
* |
795
|
|
|
* @return self |
796
|
|
|
*/ |
797
|
|
|
public function setExport( $export ) { |
798
|
|
|
$this->export = $export; |
799
|
|
|
|
800
|
|
|
return $this; |
801
|
|
|
} |
802
|
|
|
|
803
|
|
|
/** |
804
|
|
|
* Returns the time of export. |
805
|
|
|
* |
806
|
|
|
* @return \DateTime|null |
807
|
|
|
*/ |
808
|
|
|
public function getExport() { |
809
|
|
|
return $this->export; |
810
|
|
|
} |
811
|
|
|
|
812
|
|
|
/** |
813
|
|
|
* Sets the time of backup. |
814
|
|
|
* |
815
|
|
|
* @param \DateTime|null $backup |
816
|
|
|
* |
817
|
|
|
* @return self |
818
|
|
|
*/ |
819
|
|
|
public function setBackup( $backup ) { |
820
|
|
|
$this->backup = $backup; |
821
|
|
|
|
822
|
|
|
return $this; |
823
|
|
|
} |
824
|
|
|
|
825
|
|
|
/** |
826
|
|
|
* Returns the time of backup. |
827
|
|
|
* |
828
|
|
|
* @return \DateTime|null |
829
|
|
|
*/ |
830
|
|
|
public function getBackup() { |
831
|
|
|
return $this->backup; |
832
|
|
|
} |
833
|
|
|
|
834
|
|
|
/** |
835
|
|
|
* @param boolean $wikilogin |
836
|
|
|
* |
837
|
|
|
* @return self |
838
|
|
|
*/ |
839
|
|
|
public function setWikilogin( $wikilogin ) { |
840
|
|
|
$this->wikilogin = $wikilogin; |
841
|
|
|
|
842
|
|
|
return $this; |
843
|
|
|
} |
844
|
|
|
|
845
|
|
|
/** |
846
|
|
|
* @return boolean |
847
|
|
|
*/ |
848
|
|
|
public function getWikilogin() { |
849
|
|
|
return $this->wikilogin; |
850
|
|
|
} |
851
|
|
|
|
852
|
|
|
/** |
853
|
|
|
* @param string|null $tracking |
854
|
|
|
* |
855
|
|
|
* @return self |
856
|
|
|
*/ |
857
|
|
|
public function setTracking( $tracking ) { |
858
|
|
|
$this->tracking = $tracking; |
859
|
|
|
|
860
|
|
|
return $this; |
861
|
|
|
} |
862
|
|
|
|
863
|
|
|
/** |
864
|
|
|
* @return string|null |
865
|
|
|
*/ |
866
|
|
|
public function getTracking() { |
867
|
|
|
return $this->tracking; |
868
|
|
|
} |
869
|
|
|
|
870
|
|
|
/** |
871
|
|
|
* Sets the status of the membership request. |
872
|
|
|
* The allowed values are the STATUS_ constants in this class. |
873
|
|
|
* |
874
|
|
|
* @param integer $status |
875
|
|
|
* |
876
|
|
|
* @return self |
877
|
|
|
*/ |
878
|
4 |
|
public function setStatus( $status ) { |
879
|
4 |
|
$this->status = $status; |
880
|
|
|
|
881
|
4 |
|
return $this; |
882
|
|
|
} |
883
|
|
|
|
884
|
|
|
/** |
885
|
|
|
* Returns the status of the membership request. |
886
|
|
|
* The possible values are the STATUS_ constants in this class. |
887
|
|
|
* |
888
|
|
|
* @return integer |
889
|
|
|
*/ |
890
|
|
|
public function getStatus() { |
891
|
|
|
return $this->status; |
892
|
|
|
} |
893
|
|
|
|
894
|
|
|
/** |
895
|
|
|
* @param string|null $country |
896
|
|
|
* |
897
|
|
|
* @return self |
898
|
|
|
*/ |
899
|
|
|
public function setCountry( $country ) { |
900
|
|
|
$this->country = $country; |
901
|
|
|
|
902
|
|
|
return $this; |
903
|
|
|
} |
904
|
|
|
|
905
|
|
|
/** |
906
|
|
|
* @return string|null |
907
|
|
|
*/ |
908
|
|
|
public function getCountry() { |
909
|
|
|
return $this->country; |
910
|
|
|
} |
911
|
|
|
|
912
|
|
|
/** |
913
|
|
|
* @param string|null $data |
914
|
|
|
* @return self |
915
|
|
|
*/ |
916
|
|
|
public function setData( $data ) { |
917
|
|
|
$this->data = $data; |
918
|
|
|
|
919
|
|
|
return $this; |
920
|
|
|
} |
921
|
|
|
|
922
|
|
|
/** |
923
|
|
|
* @return string|null |
924
|
|
|
*/ |
925
|
|
|
public function getData() { |
926
|
|
|
return $this->data; |
927
|
|
|
} |
928
|
|
|
|
929
|
|
|
/** |
930
|
|
|
* @return bool |
931
|
|
|
*/ |
932
|
|
|
public function isUnconfirmed() { |
933
|
|
|
return $this->status === self::STATUS_NEUTRAL; |
934
|
|
|
} |
935
|
|
|
|
936
|
|
|
/** |
937
|
|
|
* @return bool |
938
|
|
|
*/ |
939
|
3 |
|
public function needsModeration() { |
940
|
3 |
|
return $this->status < 0 && abs( $this->status ) & abs( self::STATUS_MODERATION ); |
941
|
|
|
} |
942
|
|
|
|
943
|
|
|
/** |
944
|
|
|
* @return bool |
945
|
|
|
*/ |
946
|
3 |
|
public function isCancelled() { |
947
|
3 |
|
return $this->status < 0 && abs( $this->status ) & abs( self::STATUS_CANCELED ); |
948
|
|
|
} |
949
|
|
|
|
950
|
|
|
public function log( $message ) { |
951
|
|
|
$dataArray = $this->getDecodedData(); |
952
|
|
|
$dataArray[ "log" ][ date( "Y-m-d H:i:s" ) ] = $message; |
953
|
|
|
$this->encodeAndSetData( $dataArray ); |
954
|
|
|
|
955
|
|
|
return $this; |
956
|
|
|
} |
957
|
|
|
|
958
|
|
|
/** |
959
|
|
|
* NOTE: if possible, use @see getDataObject instead, as it provides a nicer API. |
960
|
|
|
* |
961
|
|
|
* @since 2.0 |
962
|
|
|
* @return array |
963
|
|
|
*/ |
964
|
5 |
|
public function getDecodedData() { |
965
|
5 |
|
$data = unserialize( base64_decode( $this->data ) ); |
966
|
|
|
|
967
|
5 |
|
return is_array( $data ) ? $data : []; |
968
|
|
|
} |
969
|
|
|
|
970
|
|
|
/** |
971
|
|
|
* NOTE: if possible, use @see modifyDataObject instead, as it provides a nicer API. |
972
|
|
|
* |
973
|
|
|
* @since 2.0 |
974
|
|
|
* @param array $data |
|
|
|
|
975
|
|
|
*/ |
976
|
4 |
|
public function encodeAndSetData( array $dataArray ) { |
977
|
4 |
|
$this->data = base64_encode( serialize( $dataArray ) ); |
978
|
4 |
|
} |
979
|
|
|
|
980
|
|
|
/** |
981
|
|
|
* WARNING: updates made to the return value will not be reflected in the Donation state. |
982
|
|
|
* Similarly, updates to the Donation state will not propagate to the returned object. |
983
|
|
|
* To update the Donation state, explicitly call @see setDataObject. |
984
|
|
|
* |
985
|
|
|
* @since 2.0 |
986
|
|
|
* @return MembershipApplicationData |
987
|
|
|
*/ |
988
|
2 |
|
public function getDataObject() { |
989
|
2 |
|
$dataArray = $this->getDecodedData(); |
990
|
|
|
|
991
|
2 |
|
$data = new MembershipApplicationData(); |
992
|
|
|
|
993
|
2 |
|
$data->setAccessToken( array_key_exists( 'token', $dataArray ) ? $dataArray['token'] : null ); |
994
|
2 |
|
$data->setUpdateToken( array_key_exists( 'utoken', $dataArray ) ? $dataArray['utoken'] : null ); |
995
|
2 |
|
$data->setPreservedStatus( array_key_exists( 'old_status', $dataArray ) ? $dataArray['old_status'] : null ); |
996
|
|
|
|
997
|
2 |
|
return $data; |
998
|
|
|
} |
999
|
|
|
|
1000
|
|
|
/** |
1001
|
|
|
* @since 2.0 |
1002
|
|
|
* @param MembershipApplicationData $data |
1003
|
|
|
*/ |
1004
|
4 |
|
public function setDataObject( MembershipApplicationData $data ) { |
1005
|
4 |
|
$dataArray = array_merge( |
1006
|
4 |
|
$this->getDecodedData(), |
1007
|
|
|
[ |
1008
|
4 |
|
'token' => $data->getAccessToken(), |
1009
|
4 |
|
'utoken' => $data->getUpdateToken(), |
1010
|
4 |
|
'old_status' => $data->getPreservedStatus(), |
1011
|
|
|
] |
1012
|
|
|
); |
1013
|
|
|
|
1014
|
4 |
|
foreach ( [ 'token', 'utoken', 'old_status' ] as $keyName ) { |
1015
|
4 |
|
if ( is_null( $dataArray[$keyName] ) ) { |
1016
|
4 |
|
unset( $dataArray[$keyName] ); |
1017
|
|
|
} |
1018
|
|
|
} |
1019
|
|
|
|
1020
|
4 |
|
$this->encodeAndSetData( $dataArray ); |
1021
|
4 |
|
} |
1022
|
|
|
|
1023
|
|
|
/** |
1024
|
|
|
* @since 2.0 |
1025
|
|
|
* @param callable $modificationFunction Takes a modifiable MembershipApplicationData parameter |
1026
|
|
|
*/ |
1027
|
1 |
|
public function modifyDataObject( callable $modificationFunction ) { |
1028
|
1 |
|
$dataObject = $this->getDataObject(); |
1029
|
1 |
|
$modificationFunction( $dataObject ); |
1030
|
1 |
|
$this->setDataObject( $dataObject ); |
1031
|
1 |
|
} |
1032
|
|
|
|
1033
|
|
|
} |
1034
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.