From 9d76351c5ad75ab6ba41e4e8d08cfc1404c2f7d7 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 13 Feb 2025 09:44:45 +0000 Subject: [PATCH] Bug 38924: Add issue and old_issue relations to Schema --- Koha/Schema/Result/Issue.pm | 15 +------------- Koha/Schema/Result/PatronQuotaUsage.pm | 27 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/Koha/Schema/Result/Issue.pm b/Koha/Schema/Result/Issue.pm index 011ac15ed78..ffb83a50e63 100644 --- a/Koha/Schema/Result/Issue.pm +++ b/Koha/Schema/Result/Issue.pm @@ -464,23 +464,10 @@ Related object: L =cut __PACKAGE__->has_many( - 'quota_usages' => 'MyApp::Schema::Result::PatronQuotaUsage', + 'quota_usages' => 'Koha::Schema::Result::PatronQuotaUsage', 'issue_id' ); -=head2 quotas - -Type: many_to_many - -Related object: L - -=cut - -__PACKAGE__->many_to_many( - 'patron_quotas' => 'patron_quota_usages', - 'patron_quota' -); - sub koha_object_class { 'Koha::Checkout'; } diff --git a/Koha/Schema/Result/PatronQuotaUsage.pm b/Koha/Schema/Result/PatronQuotaUsage.pm index dfef728c97c..dd54662f96a 100644 --- a/Koha/Schema/Result/PatronQuotaUsage.pm +++ b/Koha/Schema/Result/PatronQuotaUsage.pm @@ -145,6 +145,33 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-11-06 17:47:10 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hxeHkoIaFwVoiLReL04/4A +=head2 issue + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + issue => 'Koha::Schema::Result::Issue', + 'issue_id', + { join_type => 'left' } +); + +=head2 old_issue + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + old_issue => 'Koha::Schema::Result::OldIssue', + 'issue_id', + { join_type => 'left' } +); # You can replace this text with custom code or comments, and it will be preserved on regeneration 1; -- 2.39.5