|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the Neutrino package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) Vasil Dakov <[email protected]> |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
declare(strict_types=1); |
|
13
|
|
|
|
|
14
|
|
|
namespace VasilDakov\Speedy\Service\Track; |
|
15
|
|
|
|
|
16
|
|
|
use DateTime; |
|
17
|
|
|
use JMS\Serializer\Annotation as Serializer; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* Class TrackedParcelOperation. |
|
21
|
|
|
* |
|
22
|
|
|
* @author Vasil Dakov <[email protected]> |
|
23
|
|
|
* @copyright 2009-2023 Neutrino.bg |
|
24
|
|
|
* |
|
25
|
|
|
* @version 1.0 |
|
26
|
|
|
* @psalm-suppress MissingConstructor |
|
27
|
|
|
* @Serializer\AccessType("public_method") |
|
28
|
|
|
*/ |
|
29
|
|
|
class TrackedParcelOperation |
|
30
|
|
|
{ |
|
31
|
|
|
/** |
|
32
|
|
|
* @Serializer\Type("DateTime<'Y-m-d\TH:i:sP'>") |
|
33
|
|
|
*/ |
|
34
|
|
|
private \DateTime $dateTime; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @Serializer\Type("integer") |
|
38
|
|
|
*/ |
|
39
|
|
|
private int $operationCode; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @Serializer\Type("string") |
|
43
|
|
|
*/ |
|
44
|
|
|
private ?string $description = null; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @Serializer\Type("string") |
|
48
|
|
|
*/ |
|
49
|
|
|
private ?string $comment = null; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @Serializer\Type("string") |
|
53
|
|
|
*/ |
|
54
|
|
|
private ?string $place = null; |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* @Serializer\Type("array") |
|
58
|
|
|
*/ |
|
59
|
|
|
private array|null $additionalInfo; |
|
60
|
|
|
|
|
61
|
2 |
|
public function __construct( |
|
62
|
|
|
\DateTime $dateTime, |
|
63
|
|
|
int $operationCode, |
|
64
|
|
|
string $description, |
|
65
|
|
|
string $comment, |
|
66
|
|
|
string $place = null, |
|
67
|
|
|
?array $additionalInfo = [] |
|
68
|
|
|
) { |
|
69
|
2 |
|
$this->dateTime = $dateTime; |
|
70
|
2 |
|
$this->operationCode = $operationCode; |
|
71
|
2 |
|
$this->description = $description; |
|
72
|
2 |
|
$this->comment = $comment; |
|
73
|
2 |
|
$this->place = $place; |
|
74
|
2 |
|
$this->additionalInfo = $additionalInfo; |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
1 |
|
public function getDateTime(): \DateTime |
|
78
|
|
|
{ |
|
79
|
1 |
|
return $this->dateTime; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
4 |
|
public function setDateTime(\DateTime $dateTime): void |
|
83
|
|
|
{ |
|
84
|
4 |
|
$this->dateTime = $dateTime; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
1 |
|
public function getOperationCode(): int |
|
88
|
|
|
{ |
|
89
|
1 |
|
return $this->operationCode; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
4 |
|
public function setOperationCode(int $operationCode): void |
|
93
|
|
|
{ |
|
94
|
4 |
|
$this->operationCode = $operationCode; |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
1 |
|
public function getDescription(): ?string |
|
98
|
|
|
{ |
|
99
|
1 |
|
return $this->description; |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
4 |
|
public function setDescription(?string $description): void |
|
103
|
|
|
{ |
|
104
|
4 |
|
$this->description = $description; |
|
105
|
|
|
} |
|
106
|
|
|
|
|
107
|
1 |
|
public function getComment(): ?string |
|
108
|
|
|
{ |
|
109
|
1 |
|
return $this->comment; |
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
3 |
|
public function setComment(?string $comment): void |
|
113
|
|
|
{ |
|
114
|
3 |
|
$this->comment = $comment; |
|
115
|
|
|
} |
|
116
|
|
|
|
|
117
|
1 |
|
public function getPlace(): ?string |
|
118
|
|
|
{ |
|
119
|
1 |
|
return $this->place; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
3 |
|
public function setPlace(?string $place): void |
|
123
|
|
|
{ |
|
124
|
3 |
|
$this->place = $place; |
|
125
|
|
|
} |
|
126
|
|
|
|
|
127
|
1 |
|
public function getAdditionalInfo(): ?array |
|
128
|
|
|
{ |
|
129
|
1 |
|
return $this->additionalInfo; |
|
130
|
|
|
} |
|
131
|
|
|
|
|
132
|
4 |
|
public function setAdditionalInfo(array $additionalInfo): void |
|
133
|
|
|
{ |
|
134
|
4 |
|
$this->additionalInfo = $additionalInfo; |
|
135
|
|
|
} |
|
136
|
|
|
} |
|
137
|
|
|
|