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 integer |
||
29 | * |
||
30 | * @ORM\Column(name="id", type="integer") |
||
31 | * @ORM\Id |
||
32 | * @ORM\GeneratedValue(strategy="IDENTITY") |
||
33 | */ |
||
34 | private $id; |
||
35 | |||
36 | /** |
||
37 | * @ORM\ManyToOne(targetEntity="Address") |
||
38 | * @ORM\JoinColumn(name="address_id", referencedColumnName="id") |
||
39 | */ |
||
40 | private $address; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | * |
||
45 | * @ORM\Column(name="current_identifier", type="string", length=36, nullable=true, unique=true) |
||
46 | */ |
||
47 | private $identifier; |
||
48 | |||
49 | /** |
||
50 | * @var string |
||
51 | * |
||
52 | * @ORM\Column(name="previous_identifier", type="string", length=36, nullable=true, unique=true) |
||
53 | */ |
||
54 | private $previousIdentifier; |
||
55 | |||
56 | /** |
||
57 | * @var string |
||
58 | * |
||
59 | * @ORM\Column(name="address_type", type="string", length = 10) |
||
60 | */ |
||
61 | private $addressType; |
||
62 | |||
63 | /** |
||
64 | * Date of last export |
||
65 | * |
||
66 | * No getter / setter needed -> read access is in AddressChange repo and update in exporter code |
||
67 | * |
||
68 | * @var \DateTime |
||
69 | * |
||
70 | * @ORM\Column(name="export_date", type="datetime", nullable=true) |
||
71 | */ |
||
72 | private $exportDate; |
||
73 | |||
74 | /** |
||
75 | * When this was created |
||
76 | * |
||
77 | * No getter / setter needed, modification is in AddressChange repo |
||
78 | * |
||
79 | * @var \DateTime |
||
80 | * @ORM\Column(type="datetime") |
||
81 | */ |
||
82 | private $createdAt; |
||
83 | |||
84 | /** |
||
85 | * When this was last modified |
||
86 | * |
||
87 | * No getter / setter needed, modification is in AddressChange repo |
||
88 | * |
||
89 | * @var \DateTime |
||
90 | * @ORM\Column(type="datetime") |
||
91 | */ |
||
92 | private $modifiedAt; |
||
93 | |||
94 | 6 | public function __construct( string $addressType ) { |
|
102 | |||
103 | 6 | private function generateUuid(): void { |
|
106 | |||
107 | 3 | public function updateAddressIdentifier(): void { |
|
111 | |||
112 | 6 | public function getCurrentIdentifier(): string { |
|
118 | |||
119 | 3 | public function getPreviousIdentifier(): ?string { |
|
122 | |||
123 | public function getAddress(): Address { |
||
126 | |||
127 | public function setAddress( Address $address ) { |
||
130 | |||
131 | public function getAddressType(): string { |
||
134 | } |
||
135 |