1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace VasilDakov\Speedy\Model; |
||
6 | |||
7 | use DateTime; |
||
8 | use Doctrine\Common\Collections\ArrayCollection; |
||
9 | use JMS\Serializer\Annotation as Serializer; |
||
10 | use VasilDakov\Speedy\Traits\ToArray; |
||
11 | |||
12 | /** |
||
13 | * Class Office. |
||
14 | * |
||
15 | * @Serializer\AccessType("public_method") |
||
16 | * |
||
17 | * @author Vasil Dakov <[email protected]> |
||
18 | * @copyright 2009-2022 Neutrino.bg |
||
19 | * |
||
20 | * @version 1.0 |
||
21 | * |
||
22 | * @psalm-suppress MissingConstructor |
||
23 | * @psalm-suppress PropertyNotSetInConstructor |
||
24 | */ |
||
25 | class Office |
||
26 | { |
||
27 | use ToArray; |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
28 | |||
29 | public const TYPE_APT = 1; |
||
30 | public const TYPE_OFFICE = 2; |
||
31 | |||
32 | public const TYPES = [ |
||
33 | self::TYPE_APT => 'APT', |
||
34 | self::TYPE_OFFICE => 'OFFICE', |
||
35 | ]; |
||
36 | |||
37 | public const CARGO_TYPE_PARCEL = 1; |
||
38 | public const CARGO_TYPE_PALLET = 2; |
||
39 | public const CARGO_TYPE_TIRE = 3; |
||
40 | |||
41 | public const CARGO_TYPES = [ |
||
42 | self::CARGO_TYPE_PARCEL => 'PARCEL', |
||
43 | self::CARGO_TYPE_PALLET => 'PALLET', |
||
44 | self::CARGO_TYPE_TIRE => 'TIRE', |
||
45 | ]; |
||
46 | |||
47 | /** |
||
48 | * @Serializer\Type("int") |
||
49 | */ |
||
50 | private int $id; |
||
51 | |||
52 | /** |
||
53 | * @Serializer\Type("string") |
||
54 | */ |
||
55 | private string $name; |
||
56 | |||
57 | /** |
||
58 | * @Serializer\Type("string") |
||
59 | */ |
||
60 | private string $nameEn; |
||
61 | |||
62 | /** |
||
63 | * @Serializer\Type("int") |
||
64 | */ |
||
65 | private int $siteId; |
||
66 | |||
67 | /** |
||
68 | * @Serializer\Type("VasilDakov\Speedy\Model\Address") |
||
69 | */ |
||
70 | private Address $address; |
||
71 | |||
72 | /** |
||
73 | * @Serializer\Type("DateTime<'H:s'>") |
||
74 | */ |
||
75 | private \DateTime $workingTimeFrom; |
||
76 | |||
77 | /** |
||
78 | * @Serializer\Type("DateTime<'H:s'>") |
||
79 | */ |
||
80 | private \DateTime $workingTimeTo; |
||
81 | |||
82 | /** |
||
83 | * @Serializer\Type("DateTime<'H:s'>") |
||
84 | */ |
||
85 | private \DateTime $workingTimeHalfFrom; |
||
86 | |||
87 | /** |
||
88 | * @Serializer\Type("DateTime<'H:s'>") |
||
89 | */ |
||
90 | private \DateTime $workingTimeHalfTo; |
||
91 | |||
92 | /** |
||
93 | * @Serializer\Type("DateTime<'H:s'>") |
||
94 | */ |
||
95 | private \DateTime $workingTimeDayOffFrom; |
||
96 | |||
97 | /** |
||
98 | * @Serializer\Type("DateTime<'H:s'>") |
||
99 | */ |
||
100 | private \DateTime $workingTimeDayOffTo; |
||
101 | |||
102 | /** |
||
103 | * @Serializer\Type("DateTime<'H:s'>") |
||
104 | */ |
||
105 | private \DateTime $sameDayDepartureCutoff; |
||
106 | |||
107 | /** |
||
108 | * @Serializer\Type("DateTime<'H:s'>") |
||
109 | */ |
||
110 | private \DateTime $sameDayDepartureCutoffHalf; |
||
111 | |||
112 | /** |
||
113 | * @Serializer\Type("DateTime<'H:s'>") |
||
114 | */ |
||
115 | private \DateTime $sameDayDepartureCutoffDayOff; |
||
116 | |||
117 | /** |
||
118 | * @Serializer\Type("VasilDakov\Speedy\Model\Size") |
||
119 | */ |
||
120 | private Size $maxParcelDimensions; |
||
121 | |||
122 | /** |
||
123 | * @Serializer\Type("float") |
||
124 | */ |
||
125 | private float $maxParcelWeight; |
||
126 | |||
127 | /** |
||
128 | * @Serializer\Type("string") |
||
129 | */ |
||
130 | private string $type; |
||
131 | |||
132 | /** |
||
133 | * @Serializer\Type("int") |
||
134 | */ |
||
135 | private int $nearbyOfficeId; |
||
136 | |||
137 | /** |
||
138 | * @Serializer\Type("ArrayCollection<VasilDakov\Speedy\Model\OfficeWorkingTimeSchedule>") |
||
139 | */ |
||
140 | private ArrayCollection $workingTimeSchedule; |
||
141 | |||
142 | /** |
||
143 | * @Serializer\Type("bool") |
||
144 | */ |
||
145 | private bool $palletOffice; |
||
146 | |||
147 | /** |
||
148 | * @Serializer\Type("bool") |
||
149 | */ |
||
150 | private bool $cardPaymentAllowed; |
||
151 | |||
152 | /** |
||
153 | * @Serializer\Type("bool") |
||
154 | */ |
||
155 | private bool $cashPaymentAllowed; |
||
156 | |||
157 | /** |
||
158 | * @Serializer\Type("DateTime<'Y-m-d'>") |
||
159 | */ |
||
160 | private \DateTime $validFrom; |
||
161 | |||
162 | /** |
||
163 | * @Serializer\Type("DateTime<'Y-m-d'>") |
||
164 | */ |
||
165 | private \DateTime $validTo; |
||
166 | |||
167 | /** |
||
168 | * @Serializer\Type("array") |
||
169 | */ |
||
170 | private array $cargoTypesAllowed; |
||
171 | |||
172 | /** |
||
173 | * @Serializer\Type("bool") |
||
174 | */ |
||
175 | private bool $pickUpAllowed; |
||
176 | |||
177 | /** |
||
178 | * @Serializer\Type("bool") |
||
179 | */ |
||
180 | private bool $dropOffAllowed; |
||
181 | |||
182 | 1 | public function __construct() |
|
183 | { |
||
184 | 1 | $this->workingTimeSchedule = new ArrayCollection(); |
|
185 | } |
||
186 | |||
187 | 1 | public function getId(): int |
|
188 | { |
||
189 | 1 | return $this->id; |
|
190 | } |
||
191 | |||
192 | 3 | public function setId(int $id): void |
|
193 | { |
||
194 | 3 | $this->id = $id; |
|
195 | } |
||
196 | |||
197 | 1 | public function getName(): string |
|
198 | { |
||
199 | 1 | return $this->name; |
|
200 | } |
||
201 | |||
202 | 3 | public function setName(string $name): void |
|
203 | { |
||
204 | 3 | $this->name = $name; |
|
205 | } |
||
206 | |||
207 | 1 | public function getNameEn(): string |
|
208 | { |
||
209 | 1 | return $this->nameEn; |
|
210 | } |
||
211 | |||
212 | 3 | public function setNameEn(string $nameEn): void |
|
213 | { |
||
214 | 3 | $this->nameEn = $nameEn; |
|
215 | } |
||
216 | |||
217 | 1 | public function getSiteId(): int |
|
218 | { |
||
219 | 1 | return $this->siteId; |
|
220 | } |
||
221 | |||
222 | 3 | public function setSiteId(int $siteId): void |
|
223 | { |
||
224 | 3 | $this->siteId = $siteId; |
|
225 | } |
||
226 | |||
227 | 1 | public function getAddress(): Address |
|
228 | { |
||
229 | 1 | return $this->address; |
|
230 | } |
||
231 | |||
232 | 3 | public function setAddress(Address $address): void |
|
233 | { |
||
234 | 3 | $this->address = $address; |
|
235 | } |
||
236 | |||
237 | 1 | public function getWorkingTimeFrom(): \DateTime |
|
238 | { |
||
239 | 1 | return $this->workingTimeFrom; |
|
240 | } |
||
241 | |||
242 | 3 | public function setWorkingTimeFrom(\DateTime $workingTimeFrom): void |
|
243 | { |
||
244 | 3 | $this->workingTimeFrom = $workingTimeFrom; |
|
245 | } |
||
246 | |||
247 | 1 | public function getWorkingTimeTo(): \DateTime |
|
248 | { |
||
249 | 1 | return $this->workingTimeTo; |
|
250 | } |
||
251 | |||
252 | 3 | public function setWorkingTimeTo(\DateTime $workingTimeTo): void |
|
253 | { |
||
254 | 3 | $this->workingTimeTo = $workingTimeTo; |
|
255 | } |
||
256 | |||
257 | 1 | public function getWorkingTimeHalfFrom(): \DateTime |
|
258 | { |
||
259 | 1 | return $this->workingTimeHalfFrom; |
|
260 | } |
||
261 | |||
262 | 3 | public function setWorkingTimeHalfFrom(\DateTime $workingTimeHalfFrom): void |
|
263 | { |
||
264 | 3 | $this->workingTimeHalfFrom = $workingTimeHalfFrom; |
|
265 | } |
||
266 | |||
267 | 1 | public function getWorkingTimeHalfTo(): \DateTime |
|
268 | { |
||
269 | 1 | return $this->workingTimeHalfTo; |
|
270 | } |
||
271 | |||
272 | 3 | public function setWorkingTimeHalfTo(\DateTime $workingTimeHalfTo): void |
|
273 | { |
||
274 | 3 | $this->workingTimeHalfTo = $workingTimeHalfTo; |
|
275 | } |
||
276 | |||
277 | 1 | public function getWorkingTimeDayOffFrom(): \DateTime |
|
278 | { |
||
279 | 1 | return $this->workingTimeDayOffFrom; |
|
280 | } |
||
281 | |||
282 | 3 | public function setWorkingTimeDayOffFrom(\DateTime $workingTimeDayOffFrom): void |
|
283 | { |
||
284 | 3 | $this->workingTimeDayOffFrom = $workingTimeDayOffFrom; |
|
285 | } |
||
286 | |||
287 | 1 | public function getWorkingTimeDayOffTo(): \DateTime |
|
288 | { |
||
289 | 1 | return $this->workingTimeDayOffTo; |
|
290 | } |
||
291 | |||
292 | 3 | public function setWorkingTimeDayOffTo(\DateTime $workingTimeDayOffTo): void |
|
293 | { |
||
294 | 3 | $this->workingTimeDayOffTo = $workingTimeDayOffTo; |
|
295 | } |
||
296 | |||
297 | 1 | public function getSameDayDepartureCutoff(): \DateTime |
|
298 | { |
||
299 | 1 | return $this->sameDayDepartureCutoff; |
|
300 | } |
||
301 | |||
302 | 3 | public function setSameDayDepartureCutoff(\DateTime $sameDayDepartureCutoff): void |
|
303 | { |
||
304 | 3 | $this->sameDayDepartureCutoff = $sameDayDepartureCutoff; |
|
305 | } |
||
306 | |||
307 | 1 | public function getSameDayDepartureCutoffHalf(): \DateTime |
|
308 | { |
||
309 | 1 | return $this->sameDayDepartureCutoffHalf; |
|
310 | } |
||
311 | |||
312 | 3 | public function setSameDayDepartureCutoffHalf(\DateTime $sameDayDepartureCutoffHalf): void |
|
313 | { |
||
314 | 3 | $this->sameDayDepartureCutoffHalf = $sameDayDepartureCutoffHalf; |
|
315 | } |
||
316 | |||
317 | 1 | public function getSameDayDepartureCutoffDayOff(): \DateTime |
|
318 | { |
||
319 | 1 | return $this->sameDayDepartureCutoffDayOff; |
|
320 | } |
||
321 | |||
322 | 3 | public function setSameDayDepartureCutoffDayOff(\DateTime $sameDayDepartureCutoffDayOff): void |
|
323 | { |
||
324 | 3 | $this->sameDayDepartureCutoffDayOff = $sameDayDepartureCutoffDayOff; |
|
325 | } |
||
326 | |||
327 | 1 | public function getMaxParcelDimensions(): Size |
|
328 | { |
||
329 | 1 | return $this->maxParcelDimensions; |
|
330 | } |
||
331 | |||
332 | 3 | public function setMaxParcelDimensions(Size $maxParcelDimensions): void |
|
333 | { |
||
334 | 3 | $this->maxParcelDimensions = $maxParcelDimensions; |
|
335 | } |
||
336 | |||
337 | 1 | public function getMaxParcelWeight(): float |
|
338 | { |
||
339 | 1 | return $this->maxParcelWeight; |
|
340 | } |
||
341 | |||
342 | 3 | public function setMaxParcelWeight(float $maxParcelWeight): void |
|
343 | { |
||
344 | 3 | $this->maxParcelWeight = $maxParcelWeight; |
|
345 | } |
||
346 | |||
347 | 1 | public function getType(): string |
|
348 | { |
||
349 | 1 | return $this->type; |
|
350 | } |
||
351 | |||
352 | 3 | public function setType(string $type): void |
|
353 | { |
||
354 | 3 | $this->type = $type; |
|
355 | } |
||
356 | |||
357 | 1 | public function getNearbyOfficeId(): int |
|
358 | { |
||
359 | 1 | return $this->nearbyOfficeId; |
|
360 | } |
||
361 | |||
362 | 3 | public function setNearbyOfficeId(int $nearbyOfficeId): void |
|
363 | { |
||
364 | 3 | $this->nearbyOfficeId = $nearbyOfficeId; |
|
365 | } |
||
366 | |||
367 | 1 | public function getWorkingTimeSchedule(): ArrayCollection |
|
368 | { |
||
369 | 1 | return $this->workingTimeSchedule; |
|
370 | } |
||
371 | |||
372 | 3 | public function setWorkingTimeSchedule(ArrayCollection $workingTimeSchedule): void |
|
373 | { |
||
374 | 3 | $this->workingTimeSchedule = $workingTimeSchedule; |
|
375 | } |
||
376 | |||
377 | 1 | public function isPalletOffice(): bool |
|
378 | { |
||
379 | 1 | return $this->palletOffice; |
|
380 | } |
||
381 | |||
382 | 3 | public function setPalletOffice(bool $palletOffice): void |
|
383 | { |
||
384 | 3 | $this->palletOffice = $palletOffice; |
|
385 | } |
||
386 | |||
387 | 1 | public function isCardPaymentAllowed(): bool |
|
388 | { |
||
389 | 1 | return $this->cardPaymentAllowed; |
|
390 | } |
||
391 | |||
392 | 3 | public function setCardPaymentAllowed(bool $cardPaymentAllowed): void |
|
393 | { |
||
394 | 3 | $this->cardPaymentAllowed = $cardPaymentAllowed; |
|
395 | } |
||
396 | |||
397 | 1 | public function isCashPaymentAllowed(): bool |
|
398 | { |
||
399 | 1 | return $this->cashPaymentAllowed; |
|
400 | } |
||
401 | |||
402 | 3 | public function setCashPaymentAllowed(bool $cashPaymentAllowed): void |
|
403 | { |
||
404 | 3 | $this->cashPaymentAllowed = $cashPaymentAllowed; |
|
405 | } |
||
406 | |||
407 | 1 | public function getValidFrom(): \DateTime |
|
408 | { |
||
409 | 1 | return $this->validFrom; |
|
410 | } |
||
411 | |||
412 | 3 | public function setValidFrom(\DateTime $validFrom): void |
|
413 | { |
||
414 | 3 | $this->validFrom = $validFrom; |
|
415 | } |
||
416 | |||
417 | 1 | public function getValidTo(): \DateTime |
|
418 | { |
||
419 | 1 | return $this->validTo; |
|
420 | } |
||
421 | |||
422 | 3 | public function setValidTo(\DateTime $validTo): void |
|
423 | { |
||
424 | 3 | $this->validTo = $validTo; |
|
425 | } |
||
426 | |||
427 | 1 | public function getCargoTypesAllowed(): array |
|
428 | { |
||
429 | 1 | return $this->cargoTypesAllowed; |
|
430 | } |
||
431 | |||
432 | 3 | public function setCargoTypesAllowed(array $cargoTypesAllowed): void |
|
433 | { |
||
434 | 3 | $this->cargoTypesAllowed = $cargoTypesAllowed; |
|
435 | } |
||
436 | |||
437 | 1 | public function isPickUpAllowed(): bool |
|
438 | { |
||
439 | 1 | return $this->pickUpAllowed; |
|
440 | } |
||
441 | |||
442 | 3 | public function setPickUpAllowed(bool $pickUpAllowed): void |
|
443 | { |
||
444 | 3 | $this->pickUpAllowed = $pickUpAllowed; |
|
445 | } |
||
446 | |||
447 | 1 | public function isDropOffAllowed(): bool |
|
448 | { |
||
449 | 1 | return $this->dropOffAllowed; |
|
450 | } |
||
451 | |||
452 | 3 | public function setDropOffAllowed(bool $dropOffAllowed): void |
|
453 | { |
||
454 | 3 | $this->dropOffAllowed = $dropOffAllowed; |
|
455 | } |
||
456 | } |
||
457 |