Bug 21797: Update two-column templates with Bootstrap grid: Acquisitions part 5
[koha.git] / Koha / Schema / Result / Itemtype.pm
blobfdd507da6c2d024717ea03d8045e517f81c08c6c
1 use utf8;
2 package Koha::Schema::Result::Itemtype;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::Itemtype
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<itemtypes>
20 =cut
22 __PACKAGE__->table("itemtypes");
24 =head1 ACCESSORS
26 =head2 itemtype
28 data_type: 'varchar'
29 default_value: (empty string)
30 is_nullable: 0
31 size: 10
33 =head2 description
35 data_type: 'longtext'
36 is_nullable: 1
38 =head2 rentalcharge
40 data_type: 'decimal'
41 is_nullable: 1
42 size: [28,6]
44 =head2 defaultreplacecost
46 data_type: 'decimal'
47 is_nullable: 1
48 size: [28,6]
50 =head2 processfee
52 data_type: 'decimal'
53 is_nullable: 1
54 size: [28,6]
56 =head2 notforloan
58 data_type: 'smallint'
59 is_nullable: 1
61 =head2 imageurl
63 data_type: 'varchar'
64 is_nullable: 1
65 size: 200
67 =head2 summary
69 data_type: 'mediumtext'
70 is_nullable: 1
72 =head2 checkinmsg
74 data_type: 'varchar'
75 is_nullable: 1
76 size: 255
78 =head2 checkinmsgtype
80 data_type: 'char'
81 default_value: 'message'
82 is_nullable: 0
83 size: 16
85 =head2 sip_media_type
87 data_type: 'varchar'
88 is_nullable: 1
89 size: 3
91 =head2 hideinopac
93 data_type: 'tinyint'
94 default_value: 0
95 is_nullable: 0
97 =head2 searchcategory
99 data_type: 'varchar'
100 is_nullable: 1
101 size: 80
103 =cut
105 __PACKAGE__->add_columns(
106 "itemtype",
107 { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
108 "description",
109 { data_type => "longtext", is_nullable => 1 },
110 "rentalcharge",
111 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
112 "defaultreplacecost",
113 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
114 "processfee",
115 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
116 "notforloan",
117 { data_type => "smallint", is_nullable => 1 },
118 "imageurl",
119 { data_type => "varchar", is_nullable => 1, size => 200 },
120 "summary",
121 { data_type => "mediumtext", is_nullable => 1 },
122 "checkinmsg",
123 { data_type => "varchar", is_nullable => 1, size => 255 },
124 "checkinmsgtype",
126 data_type => "char",
127 default_value => "message",
128 is_nullable => 0,
129 size => 16,
131 "sip_media_type",
132 { data_type => "varchar", is_nullable => 1, size => 3 },
133 "hideinopac",
134 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
135 "searchcategory",
136 { data_type => "varchar", is_nullable => 1, size => 80 },
139 =head1 PRIMARY KEY
141 =over 4
143 =item * L</itemtype>
145 =back
147 =cut
149 __PACKAGE__->set_primary_key("itemtype");
151 =head1 RELATIONS
153 =head2 branch_item_rules
155 Type: has_many
157 Related object: L<Koha::Schema::Result::BranchItemRule>
159 =cut
161 __PACKAGE__->has_many(
162 "branch_item_rules",
163 "Koha::Schema::Result::BranchItemRule",
164 { "foreign.itemtype" => "self.itemtype" },
165 { cascade_copy => 0, cascade_delete => 0 },
168 =head2 circulation_rules
170 Type: has_many
172 Related object: L<Koha::Schema::Result::CirculationRule>
174 =cut
176 __PACKAGE__->has_many(
177 "circulation_rules",
178 "Koha::Schema::Result::CirculationRule",
179 { "foreign.itemtype" => "self.itemtype" },
180 { cascade_copy => 0, cascade_delete => 0 },
183 =head2 default_branch_item_rule
185 Type: might_have
187 Related object: L<Koha::Schema::Result::DefaultBranchItemRule>
189 =cut
191 __PACKAGE__->might_have(
192 "default_branch_item_rule",
193 "Koha::Schema::Result::DefaultBranchItemRule",
194 { "foreign.itemtype" => "self.itemtype" },
195 { cascade_copy => 0, cascade_delete => 0 },
198 =head2 old_reserves
200 Type: has_many
202 Related object: L<Koha::Schema::Result::OldReserve>
204 =cut
206 __PACKAGE__->has_many(
207 "old_reserves",
208 "Koha::Schema::Result::OldReserve",
209 { "foreign.itemtype" => "self.itemtype" },
210 { cascade_copy => 0, cascade_delete => 0 },
213 =head2 reserves
215 Type: has_many
217 Related object: L<Koha::Schema::Result::Reserve>
219 =cut
221 __PACKAGE__->has_many(
222 "reserves",
223 "Koha::Schema::Result::Reserve",
224 { "foreign.itemtype" => "self.itemtype" },
225 { cascade_copy => 0, cascade_delete => 0 },
229 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-05 14:29:17
230 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GthTVMBLO5Zi6NU3up3m+A
232 # Use the ItemtypeLocalization view to create the join on localization
233 our $LANGUAGE;
234 __PACKAGE__->has_many(
235 "localization" => "Koha::Schema::Result::ItemtypeLocalization",
236 sub {
237 my $args = shift;
239 die "no lang specified!" unless $LANGUAGE;
241 return ({
242 "$args->{self_alias}.itemtype" => { -ident => "$args->{foreign_alias}.code" },
243 "$args->{foreign_alias}.lang" => $LANGUAGE,