Bug 21443: Mark new columns as boolean in schema file
[koha.git] / Koha / Schema / Result / Itemtype.pm
blobb180a90c4900b10b8bfd510e2a3540238cc9ecd7
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 rentalcharge_daily
46 data_type: 'decimal'
47 is_nullable: 1
48 size: [28,6]
50 =head2 rentalcharge_daily_calendar
52 data_type: 'tinyint'
53 default_value: 1
54 is_nullable: 0
56 =head2 rentalcharge_hourly
58 data_type: 'decimal'
59 is_nullable: 1
60 size: [28,6]
62 =head2 rentalcharge_hourly_calendar
64 data_type: 'tinyint'
65 default_value: 1
66 is_nullable: 0
68 =head2 defaultreplacecost
70 data_type: 'decimal'
71 is_nullable: 1
72 size: [28,6]
74 =head2 processfee
76 data_type: 'decimal'
77 is_nullable: 1
78 size: [28,6]
80 =head2 notforloan
82 data_type: 'smallint'
83 is_nullable: 1
85 =head2 imageurl
87 data_type: 'varchar'
88 is_nullable: 1
89 size: 200
91 =head2 summary
93 data_type: 'mediumtext'
94 is_nullable: 1
96 =head2 checkinmsg
98 data_type: 'varchar'
99 is_nullable: 1
100 size: 255
102 =head2 checkinmsgtype
104 data_type: 'char'
105 default_value: 'message'
106 is_nullable: 0
107 size: 16
109 =head2 sip_media_type
111 data_type: 'varchar'
112 is_nullable: 1
113 size: 3
115 =head2 hideinopac
117 data_type: 'tinyint'
118 default_value: 0
119 is_nullable: 0
121 =head2 searchcategory
123 data_type: 'varchar'
124 is_nullable: 1
125 size: 80
127 =cut
129 __PACKAGE__->add_columns(
130 "itemtype",
131 { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
132 "description",
133 { data_type => "longtext", is_nullable => 1 },
134 "rentalcharge",
135 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
136 "rentalcharge_daily",
137 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
138 "rentalcharge_daily_calendar",
139 { data_type => "tinyint", default_value => 1, is_nullable => 0 },
140 "rentalcharge_hourly",
141 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
142 "rentalcharge_hourly_calendar",
143 { data_type => "tinyint", default_value => 1, is_nullable => 0 },
144 "defaultreplacecost",
145 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
146 "processfee",
147 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
148 "notforloan",
149 { data_type => "smallint", is_nullable => 1 },
150 "imageurl",
151 { data_type => "varchar", is_nullable => 1, size => 200 },
152 "summary",
153 { data_type => "mediumtext", is_nullable => 1 },
154 "checkinmsg",
155 { data_type => "varchar", is_nullable => 1, size => 255 },
156 "checkinmsgtype",
158 data_type => "char",
159 default_value => "message",
160 is_nullable => 0,
161 size => 16,
163 "sip_media_type",
164 { data_type => "varchar", is_nullable => 1, size => 3 },
165 "hideinopac",
166 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
167 "searchcategory",
168 { data_type => "varchar", is_nullable => 1, size => 80 },
171 =head1 PRIMARY KEY
173 =over 4
175 =item * L</itemtype>
177 =back
179 =cut
181 __PACKAGE__->set_primary_key("itemtype");
183 =head1 RELATIONS
185 =head2 circulation_rules
187 Type: has_many
189 Related object: L<Koha::Schema::Result::CirculationRule>
191 =cut
193 __PACKAGE__->has_many(
194 "circulation_rules",
195 "Koha::Schema::Result::CirculationRule",
196 { "foreign.itemtype" => "self.itemtype" },
197 { cascade_copy => 0, cascade_delete => 0 },
200 =head2 itemtypes_branches
202 Type: has_many
204 Related object: L<Koha::Schema::Result::ItemtypesBranch>
206 =cut
208 __PACKAGE__->has_many(
209 "itemtypes_branches",
210 "Koha::Schema::Result::ItemtypesBranch",
211 { "foreign.itemtype" => "self.itemtype" },
212 { cascade_copy => 0, cascade_delete => 0 },
215 =head2 old_reserves
217 Type: has_many
219 Related object: L<Koha::Schema::Result::OldReserve>
221 =cut
223 __PACKAGE__->has_many(
224 "old_reserves",
225 "Koha::Schema::Result::OldReserve",
226 { "foreign.itemtype" => "self.itemtype" },
227 { cascade_copy => 0, cascade_delete => 0 },
230 =head2 reserves
232 Type: has_many
234 Related object: L<Koha::Schema::Result::Reserve>
236 =cut
238 __PACKAGE__->has_many(
239 "reserves",
240 "Koha::Schema::Result::Reserve",
241 { "foreign.itemtype" => "self.itemtype" },
242 { cascade_copy => 0, cascade_delete => 0 },
246 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-09 17:13:18
247 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7ojvTzsDvdHPAJMwJrAZ7A
249 __PACKAGE__->add_columns(
250 '+rentalcharge_hourly_calendar' => { is_boolean => 1 },
251 '+rentalcharge_daily_calendar' => { is_boolean => 1 },
254 # Use the ItemtypeLocalization view to create the join on localization
255 our $LANGUAGE;
256 __PACKAGE__->has_many(
257 "localization" => "Koha::Schema::Result::ItemtypeLocalization",
258 sub {
259 my $args = shift;
261 die "no lang specified!" unless $LANGUAGE;
263 return ({
264 "$args->{self_alias}.itemtype" => { -ident => "$args->{foreign_alias}.code" },
265 "$args->{foreign_alias}.lang" => $LANGUAGE,
271 sub koha_object_class {
272 'Koha::ItemType';
274 sub koha_objects_class {
275 'Koha::ItemTypes';