1 package Koha::CurbsidePickupPolicy;
3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 3 of the License, or (at your option) any later
10 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License along
15 # with Koha; if not, write to the Free Software Foundation, Inc.,
16 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 use Koha::CurbsidePickupOpeningSlots;
26 use base qw(Koha::Object);
30 Koha::CurbsidePickupPolicy - Koha Curbside Pickup Policy Object class
38 Return the branch associated with this policy
44 my $rs = $self->_result->branchcode;
46 return Koha::Library->_new_from_dbic( $rs );
51 my $rs = $self->_result->curbside_pickup_opening_slots;
53 return Koha::CurbsidePickupOpeningSlots->_new_from_dbic( $rs );
56 sub add_opening_slot {
57 my ( $self, $slot ) = @_;
59 my ( $day, $start, $end ) = split '-', $slot;
60 my ( $start_hour, $start_minute ) = split ':', $start;
61 my ( $end_hour, $end_minute ) = split ':', $end;
63 return Koha::CurbsidePickupOpeningSlot->new(
65 curbside_pickup_policy_id => $self->id,
67 start_hour => $start_hour,
68 start_minute => $start_minute,
69 end_hour => $end_hour,
70 end_minute => $end_minute,
75 =head2 Internal methods
82 return 'CurbsidePickupPolicy';