From 6233475801f17c9b57adcc52a70e200a8f6202b8 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 24 Aug 2022 16:00:52 +0100 Subject: [PATCH] Bug 31095: Add restrictions accessor to Koha::Patron Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 83b3ccc3c805c1810d362811335a3cc28de3a561) Signed-off-by: Matt Blenkinsop --- Koha/Patron.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 96a72a393a..26aa414f71 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -51,6 +51,7 @@ use Koha::Patron::Images; use Koha::Patron::Messages; use Koha::Patron::Modifications; use Koha::Patron::Relationships; +use Koha::Patron::Restrictions; use Koha::Patrons; use Koha::Plugins; use Koha::Recalls; @@ -1256,6 +1257,21 @@ sub overdues { ); } + +=head3 restrictions + + my $restrictions = $patron->restrictions; + +Returns the patron restrictions. + +=cut + +sub restrictions { + my ($self) = @_; + my $restrictions_rs = $self->_result->borrower_debarments; + return Koha::Patron::Restrictions->_new_from_dbic($restrictions_rs); +} + =head3 get_routing_lists my $routinglists = $patron->get_routing_lists -- 2.39.5