Bug 23152: Implement koha_object[s]_class when needed
[koha-equinox.git] / Koha / Schema / Result / Stockrotationstage.pm
1 use utf8;
2 package Koha::Schema::Result::Stockrotationstage;
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::Stockrotationstage
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<stockrotationstages>
19
20 =cut
21
22 __PACKAGE__->table("stockrotationstages");
23
24 =head1 ACCESSORS
25
26 =head2 stage_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 position
33
34   data_type: 'integer'
35   is_nullable: 0
36
37 =head2 rota_id
38
39   data_type: 'integer'
40   is_foreign_key: 1
41   is_nullable: 0
42
43 =head2 branchcode_id
44
45   data_type: 'varchar'
46   is_foreign_key: 1
47   is_nullable: 0
48   size: 10
49
50 =head2 duration
51
52   data_type: 'integer'
53   default_value: 4
54   is_nullable: 0
55
56 =cut
57
58 __PACKAGE__->add_columns(
59   "stage_id",
60   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
61   "position",
62   { data_type => "integer", is_nullable => 0 },
63   "rota_id",
64   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
65   "branchcode_id",
66   { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
67   "duration",
68   { data_type => "integer", default_value => 4, is_nullable => 0 },
69 );
70
71 =head1 PRIMARY KEY
72
73 =over 4
74
75 =item * L</stage_id>
76
77 =back
78
79 =cut
80
81 __PACKAGE__->set_primary_key("stage_id");
82
83 =head1 RELATIONS
84
85 =head2 branchcode
86
87 Type: belongs_to
88
89 Related object: L<Koha::Schema::Result::Branch>
90
91 =cut
92
93 __PACKAGE__->belongs_to(
94   "branchcode",
95   "Koha::Schema::Result::Branch",
96   { branchcode => "branchcode_id" },
97   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
98 );
99
100 =head2 rota
101
102 Type: belongs_to
103
104 Related object: L<Koha::Schema::Result::Stockrotationrota>
105
106 =cut
107
108 __PACKAGE__->belongs_to(
109   "rota",
110   "Koha::Schema::Result::Stockrotationrota",
111   { rota_id => "rota_id" },
112   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
113 );
114
115 =head2 stockrotationitems
116
117 Type: has_many
118
119 Related object: L<Koha::Schema::Result::Stockrotationitem>
120
121 =cut
122
123 __PACKAGE__->has_many(
124   "stockrotationitems",
125   "Koha::Schema::Result::Stockrotationitem",
126   { "foreign.stage_id" => "self.stage_id" },
127   { cascade_copy => 0, cascade_delete => 0 },
128 );
129
130
131 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-09 15:50:42
132 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SKkedF8PL3DWma8kv8yYmg
133
134 # We use DBIx::Class::Ordered to handle stages manipulation.
135 __PACKAGE__->load_components(qw( Ordered ));
136
137 __PACKAGE__->grouping_column('rota_id'); # Our group_id
138
139 sub koha_object_class {
140     'Koha::StockRotationStage';
141 }
142 sub koha_objects_class {
143     'Koha::StockRotationStages';
144 }
145
146 1;