Bug 18409: Make the controller for holds use Koha::Holds
[koha-equinox.git] / Koha / Schema / Result / Reserve.pm
1 use utf8;
2 package Koha::Schema::Result::Reserve;
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::Reserve
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<reserves>
19
20 =cut
21
22 __PACKAGE__->table("reserves");
23
24 =head1 ACCESSORS
25
26 =head2 reserve_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 borrowernumber
33
34   data_type: 'integer'
35   default_value: 0
36   is_foreign_key: 1
37   is_nullable: 0
38
39 =head2 reservedate
40
41   data_type: 'date'
42   datetime_undef_if_invalid: 1
43   is_nullable: 1
44
45 =head2 biblionumber
46
47   data_type: 'integer'
48   default_value: 0
49   is_foreign_key: 1
50   is_nullable: 0
51
52 =head2 branchcode
53
54   data_type: 'varchar'
55   is_foreign_key: 1
56   is_nullable: 1
57   size: 10
58
59 =head2 notificationdate
60
61   data_type: 'date'
62   datetime_undef_if_invalid: 1
63   is_nullable: 1
64
65 =head2 reminderdate
66
67   data_type: 'date'
68   datetime_undef_if_invalid: 1
69   is_nullable: 1
70
71 =head2 cancellationdate
72
73   data_type: 'date'
74   datetime_undef_if_invalid: 1
75   is_nullable: 1
76
77 =head2 reservenotes
78
79   data_type: 'mediumtext'
80   is_nullable: 1
81
82 =head2 priority
83
84   data_type: 'smallint'
85   is_nullable: 1
86
87 =head2 found
88
89   data_type: 'varchar'
90   is_nullable: 1
91   size: 1
92
93 =head2 timestamp
94
95   data_type: 'timestamp'
96   datetime_undef_if_invalid: 1
97   default_value: current_timestamp
98   is_nullable: 0
99
100 =head2 itemnumber
101
102   data_type: 'integer'
103   is_foreign_key: 1
104   is_nullable: 1
105
106 =head2 waitingdate
107
108   data_type: 'date'
109   datetime_undef_if_invalid: 1
110   is_nullable: 1
111
112 =head2 expirationdate
113
114   data_type: 'date'
115   datetime_undef_if_invalid: 1
116   is_nullable: 1
117
118 =head2 lowestPriority
119
120   accessor: 'lowest_priority'
121   data_type: 'tinyint'
122   is_nullable: 0
123
124 =head2 suspend
125
126   data_type: 'tinyint'
127   default_value: 0
128   is_nullable: 0
129
130 =head2 suspend_until
131
132   data_type: 'datetime'
133   datetime_undef_if_invalid: 1
134   is_nullable: 1
135
136 =head2 itemtype
137
138   data_type: 'varchar'
139   is_foreign_key: 1
140   is_nullable: 1
141   size: 10
142
143 =cut
144
145 __PACKAGE__->add_columns(
146   "reserve_id",
147   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
148   "borrowernumber",
149   {
150     data_type      => "integer",
151     default_value  => 0,
152     is_foreign_key => 1,
153     is_nullable    => 0,
154   },
155   "reservedate",
156   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
157   "biblionumber",
158   {
159     data_type      => "integer",
160     default_value  => 0,
161     is_foreign_key => 1,
162     is_nullable    => 0,
163   },
164   "branchcode",
165   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
166   "notificationdate",
167   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
168   "reminderdate",
169   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
170   "cancellationdate",
171   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
172   "reservenotes",
173   { data_type => "mediumtext", is_nullable => 1 },
174   "priority",
175   { data_type => "smallint", is_nullable => 1 },
176   "found",
177   { data_type => "varchar", is_nullable => 1, size => 1 },
178   "timestamp",
179   {
180     data_type => "timestamp",
181     datetime_undef_if_invalid => 1,
182     default_value => \"current_timestamp",
183     is_nullable => 0,
184   },
185   "itemnumber",
186   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
187   "waitingdate",
188   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
189   "expirationdate",
190   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
191   "lowestPriority",
192   { accessor => "lowest_priority", data_type => "tinyint", is_nullable => 0 },
193   "suspend",
194   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
195   "suspend_until",
196   {
197     data_type => "datetime",
198     datetime_undef_if_invalid => 1,
199     is_nullable => 1,
200   },
201   "itemtype",
202   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
203 );
204
205 =head1 PRIMARY KEY
206
207 =over 4
208
209 =item * L</reserve_id>
210
211 =back
212
213 =cut
214
215 __PACKAGE__->set_primary_key("reserve_id");
216
217 =head1 RELATIONS
218
219 =head2 biblionumber
220
221 Type: belongs_to
222
223 Related object: L<Koha::Schema::Result::Biblio>
224
225 =cut
226
227 __PACKAGE__->belongs_to(
228   "biblionumber",
229   "Koha::Schema::Result::Biblio",
230   { biblionumber => "biblionumber" },
231   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
232 );
233
234 =head2 borrowernumber
235
236 Type: belongs_to
237
238 Related object: L<Koha::Schema::Result::Borrower>
239
240 =cut
241
242 __PACKAGE__->belongs_to(
243   "borrowernumber",
244   "Koha::Schema::Result::Borrower",
245   { borrowernumber => "borrowernumber" },
246   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
247 );
248
249 =head2 branchcode
250
251 Type: belongs_to
252
253 Related object: L<Koha::Schema::Result::Branch>
254
255 =cut
256
257 __PACKAGE__->belongs_to(
258   "branchcode",
259   "Koha::Schema::Result::Branch",
260   { branchcode => "branchcode" },
261   {
262     is_deferrable => 1,
263     join_type     => "LEFT",
264     on_delete     => "CASCADE",
265     on_update     => "CASCADE",
266   },
267 );
268
269 =head2 itemnumber
270
271 Type: belongs_to
272
273 Related object: L<Koha::Schema::Result::Item>
274
275 =cut
276
277 __PACKAGE__->belongs_to(
278   "itemnumber",
279   "Koha::Schema::Result::Item",
280   { itemnumber => "itemnumber" },
281   {
282     is_deferrable => 1,
283     join_type     => "LEFT",
284     on_delete     => "CASCADE",
285     on_update     => "CASCADE",
286   },
287 );
288
289 =head2 itemtype
290
291 Type: belongs_to
292
293 Related object: L<Koha::Schema::Result::Itemtype>
294
295 =cut
296
297 __PACKAGE__->belongs_to(
298   "itemtype",
299   "Koha::Schema::Result::Itemtype",
300   { itemtype => "itemtype" },
301   {
302     is_deferrable => 1,
303     join_type     => "LEFT",
304     on_delete     => "CASCADE",
305     on_update     => "CASCADE",
306   },
307 );
308
309
310 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-12-26 12:22:09
311 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:v9+wPKUT381CLNlusQ4LMA
312
313 __PACKAGE__->belongs_to(
314   "item",
315   "Koha::Schema::Result::Item",
316   { itemnumber => "itemnumber" },
317   {
318     is_deferrable => 1,
319     join_type     => "LEFT",
320     on_delete     => "CASCADE",
321     on_update     => "CASCADE",
322   },
323 );
324
325 __PACKAGE__->belongs_to(
326   "biblio",
327   "Koha::Schema::Result::Biblio",
328   { biblionumber => "biblionumber" },
329   {
330     is_deferrable => 1,
331     join_type     => "LEFT",
332     on_delete     => "CASCADE",
333     on_update     => "CASCADE",
334   },
335 );
336
337 __PACKAGE__->add_columns(
338     '+lowestPriority' => { is_boolean => 1 },
339     '+suspend' => { is_boolean => 1 }
340 );
341
342 1;