From 96e76523281c925bfd6575df331e0cad9b56198b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 11 Mar 2022 15:39:43 +0000 Subject: [PATCH] Bug 30275: Add renewals relation to Koha::Checkout --- Koha/Checkout.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Koha/Checkout.pm b/Koha/Checkout.pm index 34f0098d06..0767f02836 100644 --- a/Koha/Checkout.pm +++ b/Koha/Checkout.pm @@ -121,6 +121,21 @@ sub issuer { return Koha::Patron->_new_from_dbic( $issuer_rs ); } +=head3 renewals + + my $renewals = $checkout->renewals; + +Return a Koha::Checkouts::Renewals set attached to this checkout + +=cut + +sub renewals { + my ( $self ) = @_; + my $renewals_rs = $self->_result->renewals; + return unless $renewals_rs; + return Koha::Checkouts::Renewals->_new_from_dbic( $renewals_rs ); +} + =head3 to_api_mapping This method returns the mapping for representing a Koha::Checkout object -- 2.20.1