1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace VasilDakov\Speedy\Model; |
6
|
|
|
|
7
|
|
|
use DateTime; |
8
|
|
|
use JMS\Serializer\Annotation as Serializer; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Class OfficeWorkingTimeSchedule. |
12
|
|
|
* |
13
|
|
|
* @Serializer\AccessType("public_method") |
14
|
|
|
* |
15
|
|
|
* @author Valentin Valkanov <[email protected]> |
16
|
|
|
* @copyright |
17
|
|
|
* |
18
|
|
|
* @version |
19
|
|
|
*/ |
20
|
|
|
class OfficeWorkingTimeSchedule |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* @Serializer\Type("DateTime<'Y-m-d'>") |
24
|
|
|
*/ |
25
|
|
|
private \DateTime $date; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @Serializer\Type("DateTime<'H:s'>") |
29
|
|
|
*/ |
30
|
|
|
private \DateTime $workingTimeFrom; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @Serializer\Type("DateTime<'H:s'>") |
34
|
|
|
*/ |
35
|
|
|
private \DateTime $workingTimeTo; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @Serializer\Type("DateTime<'H:s'>") |
39
|
|
|
*/ |
40
|
|
|
private \DateTime $sameDayDepartureCutoff; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @Serializer\Type("bool") |
44
|
|
|
*/ |
45
|
|
|
private bool $standardSchedule; |
46
|
|
|
|
47
|
2 |
|
public function getDate(): \DateTime |
48
|
|
|
{ |
49
|
2 |
|
return $this->date; |
50
|
|
|
} |
51
|
|
|
|
52
|
4 |
|
public function setDate(\DateTime $date): void |
53
|
|
|
{ |
54
|
4 |
|
$this->date = $date; |
55
|
|
|
} |
56
|
|
|
|
57
|
2 |
|
public function getWorkingTimeFrom(): \DateTime |
58
|
|
|
{ |
59
|
2 |
|
return $this->workingTimeFrom; |
60
|
|
|
} |
61
|
|
|
|
62
|
4 |
|
public function setWorkingTimeFrom(\DateTime $workingTimeFrom): void |
63
|
|
|
{ |
64
|
4 |
|
$this->workingTimeFrom = $workingTimeFrom; |
65
|
|
|
} |
66
|
|
|
|
67
|
2 |
|
public function getWorkingTimeTo(): \DateTime |
68
|
|
|
{ |
69
|
2 |
|
return $this->workingTimeTo; |
70
|
|
|
} |
71
|
|
|
|
72
|
4 |
|
public function setWorkingTimeTo(\DateTime $workingTimeTo): void |
73
|
|
|
{ |
74
|
4 |
|
$this->workingTimeTo = $workingTimeTo; |
75
|
|
|
} |
76
|
|
|
|
77
|
2 |
|
public function getSameDayDepartureCutoff(): \DateTime |
78
|
|
|
{ |
79
|
2 |
|
return $this->sameDayDepartureCutoff; |
80
|
|
|
} |
81
|
|
|
|
82
|
4 |
|
public function setSameDayDepartureCutoff(\DateTime $sameDayDepartureCutoff): void |
83
|
|
|
{ |
84
|
4 |
|
$this->sameDayDepartureCutoff = $sameDayDepartureCutoff; |
85
|
|
|
} |
86
|
|
|
|
87
|
2 |
|
public function isStandardSchedule(): bool |
88
|
|
|
{ |
89
|
2 |
|
return $this->standardSchedule; |
90
|
|
|
} |
91
|
|
|
|
92
|
4 |
|
public function setStandardSchedule(bool $standardSchedule): void |
93
|
|
|
{ |
94
|
4 |
|
$this->standardSchedule = $standardSchedule; |
95
|
|
|
} |
96
|
|
|
|
97
|
1 |
|
public function toArray(): array |
98
|
|
|
{ |
99
|
1 |
|
return [ |
100
|
1 |
|
]; |
101
|
|
|
} |
102
|
|
|
} |
103
|
|
|
|