1 | <?php |
||
24 | class TimeSlot { |
||
25 | |||
26 | /** |
||
27 | * End date. |
||
28 | * |
||
29 | * @var DateTime |
||
30 | */ |
||
31 | private $endDate; |
||
32 | |||
33 | /** |
||
34 | * StartDate. |
||
35 | * |
||
36 | * @var DateTime |
||
37 | */ |
||
38 | private $startDate; |
||
39 | |||
40 | /** |
||
41 | * Time slots. |
||
42 | * |
||
43 | * @var TimeSlot[] |
||
44 | */ |
||
45 | private $timeSlots; |
||
46 | |||
47 | /** |
||
48 | * Constructor. |
||
49 | * |
||
50 | * @param DateTime $startDate The start date. |
||
51 | * @param DateTime $endDate The end date. |
||
52 | * @throws InvalidArgumentException Throws an illegal argument exception. |
||
53 | */ |
||
54 | public function __construct(DateTime $startDate, DateTime $endDate) { |
||
62 | |||
63 | /** |
||
64 | * Add a time slot. |
||
65 | * |
||
66 | * @param TimeSlot $timeSlot The time slot. |
||
67 | * @return TimeSlot Returns this time slot. |
||
68 | */ |
||
69 | public function addTimeSlot(TimeSlot $timeSlot): TimeSlot { |
||
73 | |||
74 | /** |
||
75 | * Get the duration. |
||
76 | * |
||
77 | * @return int Returns the duration. |
||
78 | */ |
||
79 | public function getDuration(): int { |
||
82 | |||
83 | /** |
||
84 | * Get the end date. |
||
85 | * |
||
86 | * @return DateTime Returns the end date. |
||
87 | */ |
||
88 | public function getEndDate(): DateTime { |
||
91 | |||
92 | /** |
||
93 | * Get the start date. |
||
94 | * |
||
95 | * @return DateTime Returns the start date. |
||
96 | */ |
||
97 | public function getStartDate(): DateTime { |
||
100 | |||
101 | /** |
||
102 | * Get the time slots. |
||
103 | * |
||
104 | * @return TimeSlot[] Returns the time slots. |
||
105 | */ |
||
106 | public function getTimeSlots(): array { |
||
109 | |||
110 | /** |
||
111 | * Left join without. |
||
112 | * |
||
113 | * @return TimeSlot[] Returns the time slots. |
||
114 | */ |
||
115 | public function leftJoinWithout(): array { |
||
154 | |||
155 | /** |
||
156 | * Remove a time slot. |
||
157 | * |
||
158 | * @param TimeSlot $timeSlot The time slot. |
||
159 | * @return TimeSlot Returns this time slot. |
||
160 | */ |
||
161 | public function removeTimeSlot(TimeSlot $timeSlot): TimeSlot { |
||
170 | |||
171 | /** |
||
172 | * Set the end date. |
||
173 | * |
||
174 | * @param DateTime $endDate The end date. |
||
175 | * @return TimeSlot Returns this time slot. |
||
176 | */ |
||
177 | protected function setEndDate(DateTime $endDate): TimeSlot { |
||
181 | |||
182 | /** |
||
183 | * Set the start date. |
||
184 | * |
||
185 | * @param DateTime $startDate The start date. |
||
186 | * @return TimeSlot Returns this time slot. |
||
187 | */ |
||
188 | protected function setStartDate(DateTime $startDate): TimeSlot { |
||
192 | |||
193 | /** |
||
194 | * Set the time slots. |
||
195 | * |
||
196 | * @param TimeSlot[] $timeSlots The time slots. |
||
197 | * @return TimeSlot Returns this time slot. |
||
198 | */ |
||
199 | protected function setTimeSlots(array $timeSlots): TimeSlot { |
||
203 | } |
||
204 |