@@ -, +, @@ --- Koha/Old/Checkout.pm | 15 +++++++++++++++ Koha/Schema/Result/OldIssue.pm | 15 +++++++++++++++ 2 files changed, 30 insertions(+) --- a/Koha/Old/Checkout.pm +++ a/Koha/Old/Checkout.pm @@ -90,6 +90,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 anonymize $checkout->anonymize(); --- a/Koha/Schema/Result/OldIssue.pm +++ a/Koha/Schema/Result/OldIssue.pm @@ -343,6 +343,21 @@ __PACKAGE__->belongs_to( }, ); +=head2 renewals + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "renewals", + "Koha::Schema::Result::CheckoutRenewal", + { "foreign.issue_id" => "self.issue_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 return_claim Type: might_have --