/** * It can show if two timeslot overlap each other. * * @param TimeSlot $first * @param TimeSlot $second * * @return boolean */ public static function isOverlap(TimeSlot $first, TimeSlot $second) { return !($first->getStartDate() > $second->getEndDate()) && !($first->getEndDate() < $second->getStartDate()); }
return $endTime; } function dateAIsBeforeDateB($dateA, $dateB) { } function dateAIsAfterDateB($dateA, $dateB) { } function dateAEqualsDateB($dateA, $dateB) { } function thisTimeslotIsBeforeOther($other) { return dateAIsBeforeDateB(getEndTime(), other . getStartTime()); } function thisTimeslotIsAfterOther($other) { return dateAIsAfterDateB(getStartTime(), other . getEndTime()); } } function isTimeslotABeforeTimeslotB($a, $b) { } function isTimeslotAAfterTimeslotB($a, $b) { } $a = new TimeSlot(); $b = 1; $c = 2; $a->setTimes($b, $b); echo $a->getStartTime();