Bug 25655: DBIC schema
[srvgit] / Koha / Schema / Result / Stockrotationitem.pm
1 use utf8;
2 package Koha::Schema::Result::Stockrotationitem;
3
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7 =head1 NAME
8
9 Koha::Schema::Result::Stockrotationitem
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<stockrotationitems>
19
20 =cut
21
22 __PACKAGE__->table("stockrotationitems");
23
24 =head1 ACCESSORS
25
26 =head2 itemnumber_id
27
28   data_type: 'integer'
29   is_foreign_key: 1
30   is_nullable: 0
31
32 Itemnumber to link to a stage & rota
33
34 =head2 stage_id
35
36   data_type: 'integer'
37   is_foreign_key: 1
38   is_nullable: 0
39
40 stage ID to link the item to
41
42 =head2 indemand
43
44   data_type: 'tinyint'
45   default_value: 0
46   is_nullable: 0
47
48 Should this item be skipped for rotation?
49
50 =head2 fresh
51
52   data_type: 'tinyint'
53   default_value: 0
54   is_nullable: 0
55
56 Flag showing item is only just added to rota
57
58 =cut
59
60 __PACKAGE__->add_columns(
61   "itemnumber_id",
62   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
63   "stage_id",
64   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
65   "indemand",
66   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
67   "fresh",
68   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
69 );
70
71 =head1 PRIMARY KEY
72
73 =over 4
74
75 =item * L</itemnumber_id>
76
77 =back
78
79 =cut
80
81 __PACKAGE__->set_primary_key("itemnumber_id");
82
83 =head1 RELATIONS
84
85 =head2 itemnumber
86
87 Type: belongs_to
88
89 Related object: L<Koha::Schema::Result::Item>
90
91 =cut
92
93 __PACKAGE__->belongs_to(
94   "itemnumber",
95   "Koha::Schema::Result::Item",
96   { itemnumber => "itemnumber_id" },
97   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
98 );
99
100 =head2 stage
101
102 Type: belongs_to
103
104 Related object: L<Koha::Schema::Result::Stockrotationstage>
105
106 =cut
107
108 __PACKAGE__->belongs_to(
109   "stage",
110   "Koha::Schema::Result::Stockrotationstage",
111   { stage_id => "stage_id" },
112   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
113 );
114
115
116 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
117 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:k/nuwkR8IxEq2D/L6PxmxA
118
119 __PACKAGE__->add_columns(
120   '+indemand' => { is_boolean => 1 },
121   '+fresh' => { is_boolean => 1 }
122 );
123
124 sub koha_object_class {
125     'Koha::StockRotationItem';
126 }
127 sub koha_objects_class {
128     'Koha::StockRotationItems';
129 }
130
131 1;