Bug 23152: Implement koha_object[s]_class when needed
[koha-equinox.git] / Koha / Schema / Result / Aqbasket.pm
index bb1e5a7..220d91e 100644 (file)
@@ -312,6 +312,27 @@ __PACKAGE__->many_to_many("borrowernumbers", "aqbasketusers", "borrowernumber");
 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gSw/f4JmMBzEssEFRg2fAQ
 
+__PACKAGE__->has_many(
+  "additional_field_values",
+  "Koha::Schema::Result::AdditionalFieldValue",
+  sub {
+    my ($args) = @_;
+
+    return {
+        "$args->{foreign_alias}.record_id" => { -ident => "$args->{self_alias}.basketno" },
+
+        "$args->{foreign_alias}.field_id" =>
+            { -in => \'(SELECT id FROM additional_fields WHERE tablename = "aqbasket")' },
+    };
+  },
+  { cascade_copy => 0, cascade_delete => 0 },
+);
+
+sub koha_object_class {
+    'Koha::Acquisition::Basket';
+}
+sub koha_objects_class {
+    'Koha::Acquisition::Baskets';
+}
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
 1;