From 210aea50a40e722ef1132e5f8f4f4b0468f0184f Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 14 Jan 2020 10:09:40 -0300 Subject: [PATCH] Bug 24418: Add Koha::Biblio->suggestions This patch adds the mentioned accessor. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Biblio.t => SUCCESS: Tests pass 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi --- Koha/Biblio.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index a37330801f..9ee4192e03 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -40,6 +40,7 @@ use Koha::IssuingRules; use Koha::Item::Transfer::Limits; use Koha::Items; use Koha::Libraries; +use Koha::Suggestions; use Koha::Subscriptions; =head1 NAME @@ -439,6 +440,21 @@ sub biblioitem { return $self->{_biblioitem}; } +=head3 suggestions + +my $suggestions = $self->suggestions + +Returns the related Koha::Suggestions object for this Biblio object + +=cut + +sub suggestions { + my ($self) = @_; + + my $suggestions_rs = $self->_result->suggestions; + return Koha::Suggestions->_new_from_dbic( $suggestions_rs ); +} + =head3 subscriptions my $subscriptions = $self->subscriptions -- 2.25.0