Bug 30275: Add renewals relation to Koha::Old::Checkout
Add the new 'renewals' relation to Koha::Old::Checkout to return a list of Koha::Checkouts::Renewal objects. We also add the same relation to the OldIssue schema inline. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
557dfa9eae
commit
cefbaca591
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -343,6 +343,21 @@ __PACKAGE__->belongs_to(
|
|||
},
|
||||
);
|
||||
|
||||
=head2 renewals
|
||||
|
||||
Type: has_many
|
||||
|
||||
Related object: L<Koha::Schema::Result::CheckoutRenewal>
|
||||
|
||||
=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
|
||||
|
|
|
|||
Loading…
Reference in New Issue