From d51343bc6a4aec5854c3ed29800db702cb7fb9ab Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 13 Oct 2025 08:40:19 +0000 Subject: [PATCH] Bug 40517: Add hold groups relationship to patron --- Koha/Patron.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 5d68d7c97dc..489cf7a69f6 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -46,6 +46,7 @@ use Koha::Encryption; use Koha::Exceptions; use Koha::Exceptions::Password; use Koha::Holds; +use Koha::HoldGroups; use Koha::ILL::Requests; use Koha::ItemTypes; use Koha::Old::Checkouts; @@ -1888,6 +1889,20 @@ sub old_holds { return Koha::Old::Holds->_new_from_dbic($old_holds_rs); } +=head3 hold_groups + +my $hold_groups = $patron->hold_groups + +Return all of this patron's hold groups + +=cut + +sub hold_groups { + my ($self) = @_; + my $hold_group_rs = $self->_result->hold_groups->search( {}, { order_by => 'hold_group_id' } ); + return Koha::HoldGroups->_new_from_dbic($hold_group_rs); +} + =head3 curbside_pickups my $curbside_pickups = $patron->curbside_pickups; -- 2.39.5