public static function equals(TimeSlot $a, TimeSlot $b) {

        // Compare the start dates.
        if (false === DateTimeHelper::equals($a->getStartDate(), $b->getStartDate())) {
            return false;
        }

        // Compare the end dates.
        if (false === DateTimeHelper::equals($a->getEndDate(), $b->getEndDate())) {
            return false;
        }

        // Compare the time slots count.
        if (count($a->getTimeSlots()) !== count($b->getTimeSlots())) {
            return false;
        }

        // Handle each time slot.
        for ($i = count($a->getTimeSlots()) - 1; 0 <= $i; --$i) {
            if (false === static::equals($a->getTimeSlots()[$i], $b->getTimeSlots()[$i])) {
                return false;
            }
        }

        //
        return true;
    }
public static function equals(TimeSlot $a, TimeSlot $b) {

        // Compare the start dates.
        if (false === DateTimeHelper::equals($a->getStartDate(), $b->getStartDate())) {
            return false;
        }

        // Compare the end dates.
        if (false === DateTimeHelper::equals($a->getEndDate(), $b->getEndDate())) {
            return false;
        }

        // Compare the time slots count.
        if (count($a->getTimeSlots()) !== count($b->getTimeSlots())) {
            return false;
        }

        // Handle each time slot.
        for ($i = count($a->getTimeSlots()) - 1; 0 <= $i; --$i) {
            if (false === static::equals($a->getTimeSlots()[$i], $b->getTimeSlots()[$i])) {
                return false;
            }
        }

        //
        return true;
    }
public static function equals ( TimeSlot $ a , TimeSlot $ b ) { // Compare the start dates. if ( false === DateTimeHelper :: equals ( $ a -> getStartDate ( ) , $ b -> getStartDate ( ) ) ) { return false ; } // Compare the end dates. if ( false === DateTimeHelper :: equals ( $ a -> getEndDate ( ) , $ b -> getEndDate ( ) ) ) { return false ; } // Compare the time slots count. if ( count ( $ a -> getTimeSlots ( ) ) !== count ( $ b -> getTimeSlots ( ) ) ) { return false ; } // Handle each time slot. for ( $ i = count ( $ a -> getTimeSlots ( ) ) - 1 ; 0 <= $ i ; -- $ i ) { if ( false === static :: equals ( $ a -> getTimeSlots ( ) [ $ i ] , $ b -> getTimeSlots ( ) [ $ i ] ) ) { return false ; } } // return true ; }
Determines if two time slots are equals.

@param TimeSlot $a The time slot A.
@param TimeSlot $b The time slot B.
@return bool Returns true in case of success, false otherwise.
Determines if two time slots are equals .