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 <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b351ab12de)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Martin Renvoize 2024-01-30 11:09:17 +00:00 committed by Fridolin Somers
parent 4efa290b81
commit 90bbf9a06b
1 changed files with 0 additions and 33 deletions

View File

@ -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();