From 8181e9948efe908b885b6bd0d5dd12e426b2aa41 Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Tue, 10 Mar 2020 15:21:04 -0300 Subject: [PATCH] Bug 20936: Add required relations for the OldReserve schema In order to make it work as the Reserve schema, we need those relations defined so we can fetch related object (e.g items). --- Koha/Schema/Result/OldReserve.pm | 79 ++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/Koha/Schema/Result/OldReserve.pm b/Koha/Schema/Result/OldReserve.pm index 85e604d288..6917af92c7 100644 --- a/Koha/Schema/Result/OldReserve.pm +++ b/Koha/Schema/Result/OldReserve.pm @@ -301,9 +301,88 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-18 12:43:15 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4vMUC/1kSr3vgQ7n0Pmuug +=head2 item + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "item", + "Koha::Schema::Result::Item", + { itemnumber => "itemnumber" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + +=head2 branch + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "branch", + "Koha::Schema::Result::Branch", + { branchcode => "branchcode" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + +=head2 biblio + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "biblio", + "Koha::Schema::Result::Biblio", + { biblionumber => "biblionumber" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + +__PACKAGE__->add_columns( + '+item_level_hold' => { is_boolean => 1 }, + '+lowestPriority' => { is_boolean => 1 }, + '+suspend' => { is_boolean => 1 } +); + +=head2 koha_object_class + +Returns related Koha::Object class name + +=cut + sub koha_object_class { 'Koha::Old::Hold'; } + +=head2 koha_objects_class + +Returns related Koha::Objects class name + +=cut + sub koha_objects_class { 'Koha::Old::Holds'; } -- 2.26.2