1 | <?php |
||
21 | class AddressChange { |
||
22 | |||
23 | public const ADDRESS_TYPE_PERSON = 'person'; |
||
24 | |||
25 | public const ADDRESS_TYPE_COMPANY = 'company'; |
||
26 | |||
27 | /** |
||
28 | * @var boolean |
||
29 | * |
||
30 | * @ORM\Column(name="donation_receipt", type="boolean", nullable=false) |
||
31 | */ |
||
32 | private $donationReceipt = false; |
||
33 | |||
34 | /** |
||
35 | * @var integer |
||
36 | * |
||
37 | * @ORM\Column(name="id", type="integer") |
||
38 | * @ORM\Id |
||
39 | * @ORM\GeneratedValue(strategy="IDENTITY") |
||
40 | */ |
||
41 | private $id; |
||
42 | |||
43 | /** |
||
44 | * @ORM\ManyToOne(targetEntity="Address") |
||
45 | * @ORM\JoinColumn(name="address_id", referencedColumnName="id") |
||
46 | */ |
||
47 | private $address; |
||
48 | |||
49 | /** |
||
50 | * @var string |
||
51 | * |
||
52 | * @ORM\Column(name="current_identifier", type="string", length=36, nullable=true, unique=true) |
||
53 | */ |
||
54 | private $identifier; |
||
55 | |||
56 | /** |
||
57 | * @var string |
||
58 | * |
||
59 | * @ORM\Column(name="previous_identifier", type="string", length=36, nullable=true, unique=true) |
||
60 | */ |
||
61 | private $previousIdentifier; |
||
62 | |||
63 | /** |
||
64 | * @var string |
||
65 | * |
||
66 | * @ORM\Column(name="address_type", type="string", length = 10) |
||
67 | */ |
||
68 | private $addressType; |
||
69 | |||
70 | /** |
||
71 | * Date of last export |
||
72 | * |
||
73 | * No getter / setter needed -> read access is in AddressChange repo and update in exporter code |
||
74 | * |
||
75 | * @var \DateTime |
||
76 | * |
||
77 | * @ORM\Column(name="export_date", type="datetime", nullable=true) |
||
78 | */ |
||
79 | private $exportDate; |
||
80 | |||
81 | /** |
||
82 | * When this was created |
||
83 | * |
||
84 | * No getter / setter needed, modification is in AddressChange repo |
||
85 | * |
||
86 | * @var \DateTime |
||
87 | * @ORM\Column(name="created_at", type="datetime") |
||
88 | */ |
||
89 | private $createdAt; |
||
90 | |||
91 | /** |
||
92 | * When this was last modified |
||
93 | * |
||
94 | 6 | * No getter / setter needed, modification is in AddressChange repo |
|
95 | 6 | * |
|
96 | 6 | * @var \DateTime |
|
97 | 6 | * @ORM\Column(name="modified_at", type="datetime") |
|
98 | 6 | */ |
|
99 | 6 | private $modifiedAt; |
|
100 | |||
101 | 6 | public function __construct( string $addressType ) { |
|
109 | 3 | ||
110 | 3 | private function generateUuid(): void { |
|
113 | 6 | ||
114 | public function updateAddressIdentifier(): void { |
||
118 | |||
119 | 3 | public function getCurrentIdentifier(): string { |
|
125 | |||
126 | public function getPreviousIdentifier(): ?string { |
||
129 | |||
130 | public function isOptedIntoDonationReceipt() { |
||
133 | |||
134 | public function setDonationReceipt( $donationReceipt ) { |
||
137 | |||
138 | public function getAddress(): ?Address { |
||
141 | |||
142 | public function setAddress( Address $address ) { |
||
145 | |||
146 | public function getAddressType(): string { |
||
149 | } |
||
150 |