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
|
|
|
* @version 1.0 |
25
|
|
|
* @Serializer\AccessType("public_method") |
26
|
|
|
*/ |
27
|
|
|
class TrackedParcelOperation |
28
|
|
|
{ |
29
|
|
|
/** |
30
|
|
|
* @var DateTime |
31
|
|
|
* @Serializer\Type("DateTime<'Y-m-d\TH:i:sP'>") |
32
|
|
|
*/ |
33
|
|
|
private DateTime $dateTime; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var int |
37
|
|
|
* @Serializer\Type("integer") |
38
|
|
|
*/ |
39
|
|
|
private int $operationCode; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var string |
43
|
|
|
* @Serializer\Type("string") |
44
|
|
|
*/ |
45
|
|
|
private string $description; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var string |
49
|
|
|
* @Serializer\Type("string") |
50
|
|
|
*/ |
51
|
|
|
private string $comment; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @var string|null |
55
|
|
|
* @Serializer\Type("string") |
56
|
|
|
*/ |
57
|
|
|
private ?string $place = null; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @var array |
61
|
|
|
* @Serializer\Type("array") |
62
|
|
|
*/ |
63
|
|
|
private array $additionalInfo = []; |
64
|
|
|
|
65
|
|
|
public function __construct( |
66
|
|
|
DateTime $dateTime, |
67
|
|
|
int $operationCode, |
68
|
|
|
string $description, |
69
|
|
|
string $comment, |
70
|
|
|
?string $place = null, |
|
|
|
|
71
|
|
|
?array $additionalInfo = [] |
|
|
|
|
72
|
|
|
) { |
73
|
|
|
$this->dateTime = $dateTime; |
74
|
|
|
$this->operationCode = $operationCode; |
75
|
|
|
$this->description = $description; |
76
|
|
|
$this->comment = $comment; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @return DateTime |
81
|
|
|
*/ |
82
|
|
|
public function getDateTime(): DateTime |
83
|
|
|
{ |
84
|
|
|
return $this->dateTime; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @param DateTime $dateTime |
89
|
|
|
*/ |
90
|
|
|
public function setDateTime(DateTime $dateTime): void |
91
|
|
|
{ |
92
|
|
|
$this->dateTime = $dateTime; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @return int |
97
|
|
|
*/ |
98
|
|
|
public function getOperationCode(): int |
99
|
|
|
{ |
100
|
|
|
return $this->operationCode; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @param int $operationCode |
105
|
|
|
*/ |
106
|
|
|
public function setOperationCode(int $operationCode): void |
107
|
|
|
{ |
108
|
|
|
$this->operationCode = $operationCode; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* @return string |
113
|
|
|
*/ |
114
|
|
|
public function getDescription(): string |
115
|
|
|
{ |
116
|
|
|
return $this->description; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* @param string $description |
121
|
|
|
*/ |
122
|
|
|
public function setDescription(string $description): void |
123
|
|
|
{ |
124
|
|
|
$this->description = $description; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* @return string |
129
|
|
|
*/ |
130
|
|
|
public function getComment(): string |
131
|
|
|
{ |
132
|
|
|
return $this->comment; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* @param string $comment |
137
|
|
|
*/ |
138
|
|
|
public function setComment(string $comment): void |
139
|
|
|
{ |
140
|
|
|
$this->comment = $comment; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @return string|null |
145
|
|
|
*/ |
146
|
|
|
public function getPlace(): ?string |
147
|
|
|
{ |
148
|
|
|
return $this->place; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @param string|null $place |
153
|
|
|
*/ |
154
|
|
|
public function setPlace(?string $place): void |
155
|
|
|
{ |
156
|
|
|
$this->place = $place; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* @return array|null |
161
|
|
|
*/ |
162
|
|
|
public function getAdditionalInfo(): ?array |
163
|
|
|
{ |
164
|
|
|
return $this->additionalInfo; |
165
|
|
|
} |
166
|
|
|
|
167
|
|
|
/** |
168
|
|
|
* @param array|null $additionalInfo |
169
|
|
|
*/ |
170
|
|
|
public function setAdditionalInfo(?array $additionalInfo): void |
171
|
|
|
{ |
172
|
|
|
$this->additionalInfo = $additionalInfo; |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
} |
176
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.