1 | <?php |
||
23 | class TimeSlotHelper { |
||
24 | |||
25 | /** |
||
26 | * Determines if a time slot A contains a time slot b. |
||
27 | * |
||
28 | * @param TimeSlot $a The time slot A. |
||
29 | * @param TimeSlot $b The time slot B. |
||
30 | * @return bool Returns true in case of success, false otherwise. |
||
31 | */ |
||
32 | public static function contains(TimeSlot $a, TimeSlot $b) { |
||
37 | |||
38 | /** |
||
39 | * Determines if two time slots are equals. |
||
40 | * |
||
41 | * @param TimeSlot $a The time slot A. |
||
42 | * @param TimeSlot $b The time slot B. |
||
43 | * @return bool Returns true in case of success, false otherwise. |
||
44 | */ |
||
45 | public static function equals(TimeSlot $a, TimeSlot $b) { |
||
72 | |||
73 | /** |
||
74 | * Full join two time slots. |
||
75 | * |
||
76 | * @param TimeSlot $a The time slot A. |
||
77 | * @param TimeSlot $b The time slot B. |
||
78 | * @return TimeSlot|null Returns a time slot in case of success, null otherwise. |
||
79 | */ |
||
80 | public static function fullJoin(TimeSlot $a, TimeSlot $b) { |
||
94 | |||
95 | /** |
||
96 | * Full join two time slots without time slots intersection. |
||
97 | * |
||
98 | * @param TimeSlot $a The time slot A. |
||
99 | * @param TimeSlot $b The time slot B. |
||
100 | * @return TimeSlot[]|null Returns the time slots in case of success, null otherwise. |
||
101 | */ |
||
102 | public static function fullJoinWithout(TimeSlot $a, TimeSlot $b) { |
||
122 | |||
123 | /** |
||
124 | * Get the duration. |
||
125 | * |
||
126 | * @param TimeSlot[] $timeSlots the time slots. |
||
127 | * @return int Returns the duration. |
||
128 | */ |
||
129 | public static function getDuration(array $timeSlots) { |
||
136 | |||
137 | /** |
||
138 | * Determines if a time slot A has full join with time slot B. |
||
139 | * |
||
140 | * @param TimeSlot $a The time slot A. |
||
141 | * @param TimeSlot $b The time slot B. |
||
142 | * @return bool Returns true in case of success, false otherwise. |
||
143 | */ |
||
144 | public static function hasFullJoin(TimeSlot $a, TimeSlot $b) { |
||
147 | |||
148 | /** |
||
149 | * Determines if a time slot A has an inner join with time slot B. |
||
150 | * |
||
151 | * @param TimeSlot $a The time slot A. |
||
152 | * @param TimeSlot $b The time slot B. |
||
153 | * @return bool Returns true in case of success, false otherwise. |
||
154 | */ |
||
155 | public static function hasInnerJoin(TimeSlot $a, TimeSlot $b) { |
||
162 | |||
163 | /** |
||
164 | * Inner join two time slots. |
||
165 | * |
||
166 | * @param TimeSlot $a The time slot A. |
||
167 | * @param TimeSlot $b The time slot B. |
||
168 | * @return TimeSlot|null Returns a time slot in case of success, null otherwise. |
||
169 | */ |
||
170 | public static function innerJoin(TimeSlot $a, TimeSlot $b) { |
||
184 | |||
185 | /** |
||
186 | * Left join two time slots. |
||
187 | * |
||
188 | * @param TimeSlot $a The time slot A. |
||
189 | * @param TimeSlot $b The time slot B. |
||
190 | * @return TimeSlot|null Returns the time slot in case of success, null otherwise. |
||
191 | */ |
||
192 | public static function leftJoin(TimeSlot $a, TimeSlot $b) { |
||
202 | |||
203 | /** |
||
204 | * Left join two time slots without time slot B intersection. |
||
205 | * |
||
206 | * @param TimeSlot $a The time slot A. |
||
207 | * @param TimeSlot $b The time slot B. |
||
208 | * @return TimeSlot[]|null Returns the time slots in case of success, null otherwise. |
||
209 | */ |
||
210 | public static function leftJoinWithout(TimeSlot $a, TimeSlot $b) { |
||
234 | |||
235 | /** |
||
236 | * Merge. |
||
237 | * |
||
238 | * @param TimeSlot[] $timeSlots The time slots. |
||
239 | * @return TimeSlot[] Returns the merged time slots. |
||
240 | */ |
||
241 | public static function merge(array $timeSlots) { |
||
275 | |||
276 | /** |
||
277 | * Right join two time slots. |
||
278 | * |
||
279 | * @param TimeSlot $a The time slot A. |
||
280 | * @param TimeSlot $b The time slot B. |
||
281 | * @return TimeSlot|null Returns the time slot in case of success, null otherwise. |
||
282 | */ |
||
283 | public static function rightJoin(TimeSlot $a, TimeSlot $b) { |
||
286 | |||
287 | /** |
||
288 | * Right join two time slots without time slot B intersection. |
||
289 | * |
||
290 | * @param TimeSlot $a The time slot A. |
||
291 | * @param TimeSlot $b The time slot B. |
||
292 | * @return TimeSlot[]|null Returns the time slots in case of success, null otherwise. |
||
293 | */ |
||
294 | public static function rightJoinWithout(TimeSlot $a, TimeSlot $b) { |
||
297 | |||
298 | /** |
||
299 | * Sort time slots. |
||
300 | * |
||
301 | * @param TimeSlot[] $timeSlots The time slots. |
||
302 | * @return TimeSlot[] Returns the sorted time slots. |
||
303 | */ |
||
304 | public static function sort(array $timeSlots) { |
||
313 | } |
||
314 |