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

        // Has inner join ?
        if (false === static::hasInnerJoin($a, $b) || true === static::contains($b, $a)) {
            return null;
        }

        // Contains ?
        if (true === static::contains($a, $b)) {
            return static::sort([
                    new TimeSlot(clone $a->getStartDate(), clone $b->getStartDate()),
                    new TimeSlot(clone $b->getEndDate(), clone $a->getEndDate()),
            ]);
        }

        // Initialize the date/times.
        $startDate = true === DateTimeHelper::isLessThan($a->getStartDate(), $b->getStartDate()) ? $a->getStartDate() : $b->getEndDate();
        $endDate   = true === DateTimeHelper::isGreaterThan($a->getEndDate(), $b->getEndDate()) ? $a->getEndDate() : $b->getStartDate();

        // Return the time slots.
        return [
            new TimeSlot(clone $startDate, clone $endDate),
        ];
    }
public static function leftJoinWithout(TimeSlot $a, TimeSlot $b) {

        // Has inner join ?
        if (false === static::hasInnerJoin($a, $b) || true === static::contains($b, $a)) {
            return null;
        }

        // Contains ?
        if (true === static::contains($a, $b)) {
            return static::sort([
                    new TimeSlot(clone $a->getStartDate(), clone $b->getStartDate()),
                    new TimeSlot(clone $b->getEndDate(), clone $a->getEndDate()),
            ]);
        }

        // Initialize the date/times.
        $startDate = true === DateTimeHelper::isLessThan($a->getStartDate(), $b->getStartDate()) ? $a->getStartDate() : $b->getEndDate();
        $endDate   = true === DateTimeHelper::isGreaterThan($a->getEndDate(), $b->getEndDate()) ? $a->getEndDate() : $b->getStartDate();

        // Return the time slots.
        return [
            new TimeSlot(clone $startDate, clone $endDate),
        ];
    }
public static function leftJoinWithout ( TimeSlot $ a , TimeSlot $ b ) { // Has inner join ? if ( false === static :: hasInnerJoin ( $ a , $ b ) || true === static :: contains ( $ b , $ a ) ) { return null ; } // Contains ? if ( true === static :: contains ( $ a , $ b ) ) { return static :: sort ( [ new TimeSlot ( clone $ a -> getStartDate ( ) , clone $ b -> getStartDate ( ) ) , new TimeSlot ( clone $ b -> getEndDate ( ) , clone $ a -> getEndDate ( ) ) , ] ) ; } // Initialize the date/times. $ startDate = true === DateTimeHelper :: isLessThan ( $ a -> getStartDate ( ) , $ b -> getStartDate ( ) ) ? $ a -> getStartDate ( ) : $ b -> getEndDate ( ) ; $ endDate = true === DateTimeHelper :: isGreaterThan ( $ a -> getEndDate ( ) , $ b -> getEndDate ( ) ) ? $ a -> getEndDate ( ) : $ b -> getStartDate ( ) ; // Return the time slots. return [ new TimeSlot ( clone $ startDate , clone $ endDate ) , ] ; }
Left join two time slots without time slot B intersection.

@param TimeSlot $a The time slot A.
@param TimeSlot $b The time slot B.
@return TimeSlot[] Returns the time slots in case of success, null otherwise.
Left join two time slots without time slot B intersection .