From 90bbf9a06b3897ee3197fab41c2e09884fd6e1a2 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. Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer (cherry picked from commit b351ab12de684b212d58d055b363621899465d70) Signed-off-by: Fridolin Somers --- Koha/Booking.pm | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/Koha/Booking.pm b/Koha/Booking.pm index 60dcc88d63..2aabe72a95 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.39.5