From 97bfd4be33773ee18882edb004c8a7a5a8629169 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 16 Feb 2018 13:57:07 -0300 Subject: [PATCH] Bug 18789: Add POD for is_adult and is_child Signed-off-by: Jonathan Druart --- Koha/Patron.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 84592995e2..ed4a1b3209 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -806,11 +806,26 @@ sub has_permission { return C4::Auth::haspermission( $self->userid, $flagsrequired ); } +=head3 is_adult + +my $is_adult = $patron->is_adult + +Return true if the patron has a category with a type Adult (A) or Organization (I) + +=cut + sub is_adult { my ( $self ) = @_; return $self->category->category_type =~ /^(A|I)$/ ? 1 : 0; } +=head3 is_child + +my $is_child = $patron->is_child + +Return true if the patron has a category with a type Child (C) + +=cut sub is_child { my( $self ) = @_; return $self->category->category_type eq 'C' ? 1 : 0; -- 2.39.5