From 8b9828b7bb7306b733eeb91de4a090ec5e87da0b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 24 Aug 2022 16:01:27 +0100 Subject: [PATCH] Bug 31095: Add type relation accessor to Koha::Patron::Restriction --- Koha/Patron/Restriction.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Koha/Patron/Restriction.pm b/Koha/Patron/Restriction.pm index e1f54315e4..7b5374a23b 100644 --- a/Koha/Patron/Restriction.pm +++ b/Koha/Patron/Restriction.pm @@ -29,6 +29,22 @@ Koha::Patron::Restriction - Koha Patron::Restriction Object class =head2 Class methods +=head2 Relation accessors + +=head3 type + + my $restriction_type = $restriction->type; + +Returns the restriction type + +=cut + +sub type { + my ($self) = @_; + my $type_rs = $self->_result->type; + return Koha::Patron::Restriction::Type->_new_from_dbic($type_rs); +} + =head2 Internal methods =head3 _type -- 2.20.1