From 3d41d6c8d8ad36eb028478dcd6fb01b90aeb1cf4 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 30 Jan 2024 11:09:17 +0000 Subject: [PATCH] Bug 35248: Remove Koha::Booking->intersects Another method left behind from an earlier iteration.. not actually called anywhere in the final submission in Koha. --- Koha/Booking.pm | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/Koha/Booking.pm b/Koha/Booking.pm index 60dcc88d630..2aabe72a95d 100644 --- a/Koha/Booking.pm +++ b/Koha/Booking.pm @@ -142,39 +142,6 @@ sub store { return $self; } -=head3 intersects - - my $intersects = $booking1->intersects($booking2); - -Returns a boolean denoting whether booking1 interfers/overlaps/clashes with booking2. - -=cut - -sub intersects { - my ( $self, $comp ) = @_; - - # Start date of comparison booking is after end date of this booking. - return 0 - if ( - DateTime->compare( - dt_from_string( $comp->start_date ), - dt_from_string( $self->end_date ) - ) >= 0 - ); - - # End date of comparison booking is before start date of this booking. - return 0 - if ( - DateTime->compare( - dt_from_string( $comp->end_date ), - dt_from_string( $self->start_date ) - ) <= 0 - ); - - # Bookings must overlap - return 1; -} - =head3 get_items_that_can_fill my $items = $bookings->get_items_that_can_fill(); -- 2.43.0