Bug 22784: DBIC changes
[koha.git] / Koha / Schema / Result / Suggestion.pm
1 use utf8;
2 package Koha::Schema::Result::Suggestion;
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::Suggestion
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<suggestions>
19
20 =cut
21
22 __PACKAGE__->table("suggestions");
23
24 =head1 ACCESSORS
25
26 =head2 suggestionid
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 suggestedby
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 1
37
38 =head2 suggesteddate
39
40   data_type: 'date'
41   datetime_undef_if_invalid: 1
42   is_nullable: 0
43
44 =head2 managedby
45
46   data_type: 'integer'
47   is_foreign_key: 1
48   is_nullable: 1
49
50 =head2 manageddate
51
52   data_type: 'date'
53   datetime_undef_if_invalid: 1
54   is_nullable: 1
55
56 =head2 acceptedby
57
58   data_type: 'integer'
59   is_foreign_key: 1
60   is_nullable: 1
61
62 =head2 accepteddate
63
64   data_type: 'date'
65   datetime_undef_if_invalid: 1
66   is_nullable: 1
67
68 =head2 rejectedby
69
70   data_type: 'integer'
71   is_foreign_key: 1
72   is_nullable: 1
73
74 =head2 rejecteddate
75
76   data_type: 'date'
77   datetime_undef_if_invalid: 1
78   is_nullable: 1
79
80 =head2 lastmodificationby
81
82   data_type: 'integer'
83   is_foreign_key: 1
84   is_nullable: 1
85
86 =head2 lastmodificationdate
87
88   data_type: 'date'
89   datetime_undef_if_invalid: 1
90   is_nullable: 1
91
92 =head2 STATUS
93
94   accessor: 'status'
95   data_type: 'varchar'
96   default_value: (empty string)
97   is_nullable: 0
98   size: 10
99
100 =head2 archived
101
102   data_type: 'integer'
103   default_value: 0
104   is_nullable: 0
105
106 =head2 note
107
108   data_type: 'longtext'
109   is_nullable: 1
110
111 =head2 author
112
113   data_type: 'varchar'
114   is_nullable: 1
115   size: 80
116
117 =head2 title
118
119   data_type: 'varchar'
120   is_nullable: 1
121   size: 255
122
123 =head2 copyrightdate
124
125   data_type: 'smallint'
126   is_nullable: 1
127
128 =head2 publishercode
129
130   data_type: 'varchar'
131   is_nullable: 1
132   size: 255
133
134 =head2 date
135
136   data_type: 'timestamp'
137   datetime_undef_if_invalid: 1
138   default_value: current_timestamp
139   is_nullable: 0
140
141 =head2 volumedesc
142
143   data_type: 'varchar'
144   is_nullable: 1
145   size: 255
146
147 =head2 publicationyear
148
149   data_type: 'smallint'
150   default_value: 0
151   is_nullable: 1
152
153 =head2 place
154
155   data_type: 'varchar'
156   is_nullable: 1
157   size: 255
158
159 =head2 isbn
160
161   data_type: 'varchar'
162   is_nullable: 1
163   size: 30
164
165 =head2 biblionumber
166
167   data_type: 'integer'
168   is_foreign_key: 1
169   is_nullable: 1
170
171 =head2 reason
172
173   data_type: 'mediumtext'
174   is_nullable: 1
175
176 =head2 patronreason
177
178   data_type: 'mediumtext'
179   is_nullable: 1
180
181 =head2 budgetid
182
183   data_type: 'integer'
184   is_foreign_key: 1
185   is_nullable: 1
186
187 =head2 branchcode
188
189   data_type: 'varchar'
190   is_foreign_key: 1
191   is_nullable: 1
192   size: 10
193
194 =head2 collectiontitle
195
196   data_type: 'mediumtext'
197   is_nullable: 1
198
199 =head2 itemtype
200
201   data_type: 'varchar'
202   is_nullable: 1
203   size: 30
204
205 =head2 quantity
206
207   data_type: 'smallint'
208   is_nullable: 1
209
210 =head2 currency
211
212   data_type: 'varchar'
213   is_nullable: 1
214   size: 10
215
216 =head2 price
217
218   data_type: 'decimal'
219   is_nullable: 1
220   size: [28,6]
221
222 =head2 total
223
224   data_type: 'decimal'
225   is_nullable: 1
226   size: [28,6]
227
228 =cut
229
230 __PACKAGE__->add_columns(
231   "suggestionid",
232   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
233   "suggestedby",
234   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
235   "suggesteddate",
236   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 },
237   "managedby",
238   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
239   "manageddate",
240   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
241   "acceptedby",
242   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
243   "accepteddate",
244   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
245   "rejectedby",
246   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
247   "rejecteddate",
248   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
249   "lastmodificationby",
250   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
251   "lastmodificationdate",
252   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
253   "STATUS",
254   {
255     accessor => "status",
256     data_type => "varchar",
257     default_value => "",
258     is_nullable => 0,
259     size => 10,
260   },
261   "archived",
262   { data_type => "integer", default_value => 0, is_nullable => 0 },
263   "note",
264   { data_type => "longtext", is_nullable => 1 },
265   "author",
266   { data_type => "varchar", is_nullable => 1, size => 80 },
267   "title",
268   { data_type => "varchar", is_nullable => 1, size => 255 },
269   "copyrightdate",
270   { data_type => "smallint", is_nullable => 1 },
271   "publishercode",
272   { data_type => "varchar", is_nullable => 1, size => 255 },
273   "date",
274   {
275     data_type => "timestamp",
276     datetime_undef_if_invalid => 1,
277     default_value => \"current_timestamp",
278     is_nullable => 0,
279   },
280   "volumedesc",
281   { data_type => "varchar", is_nullable => 1, size => 255 },
282   "publicationyear",
283   { data_type => "smallint", default_value => 0, is_nullable => 1 },
284   "place",
285   { data_type => "varchar", is_nullable => 1, size => 255 },
286   "isbn",
287   { data_type => "varchar", is_nullable => 1, size => 30 },
288   "biblionumber",
289   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
290   "reason",
291   { data_type => "mediumtext", is_nullable => 1 },
292   "patronreason",
293   { data_type => "mediumtext", is_nullable => 1 },
294   "budgetid",
295   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
296   "branchcode",
297   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
298   "collectiontitle",
299   { data_type => "mediumtext", is_nullable => 1 },
300   "itemtype",
301   { data_type => "varchar", is_nullable => 1, size => 30 },
302   "quantity",
303   { data_type => "smallint", is_nullable => 1 },
304   "currency",
305   { data_type => "varchar", is_nullable => 1, size => 10 },
306   "price",
307   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
308   "total",
309   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
310 );
311
312 =head1 PRIMARY KEY
313
314 =over 4
315
316 =item * L</suggestionid>
317
318 =back
319
320 =cut
321
322 __PACKAGE__->set_primary_key("suggestionid");
323
324 =head1 RELATIONS
325
326 =head2 acceptedby
327
328 Type: belongs_to
329
330 Related object: L<Koha::Schema::Result::Borrower>
331
332 =cut
333
334 __PACKAGE__->belongs_to(
335   "acceptedby",
336   "Koha::Schema::Result::Borrower",
337   { borrowernumber => "acceptedby" },
338   {
339     is_deferrable => 1,
340     join_type     => "LEFT",
341     on_delete     => "SET NULL",
342     on_update     => "CASCADE",
343   },
344 );
345
346 =head2 biblionumber
347
348 Type: belongs_to
349
350 Related object: L<Koha::Schema::Result::Biblio>
351
352 =cut
353
354 __PACKAGE__->belongs_to(
355   "biblionumber",
356   "Koha::Schema::Result::Biblio",
357   { biblionumber => "biblionumber" },
358   {
359     is_deferrable => 1,
360     join_type     => "LEFT",
361     on_delete     => "SET NULL",
362     on_update     => "CASCADE",
363   },
364 );
365
366 =head2 branchcode
367
368 Type: belongs_to
369
370 Related object: L<Koha::Schema::Result::Branch>
371
372 =cut
373
374 __PACKAGE__->belongs_to(
375   "branchcode",
376   "Koha::Schema::Result::Branch",
377   { branchcode => "branchcode" },
378   {
379     is_deferrable => 1,
380     join_type     => "LEFT",
381     on_delete     => "SET NULL",
382     on_update     => "CASCADE",
383   },
384 );
385
386 =head2 budgetid
387
388 Type: belongs_to
389
390 Related object: L<Koha::Schema::Result::Aqbudget>
391
392 =cut
393
394 __PACKAGE__->belongs_to(
395   "budgetid",
396   "Koha::Schema::Result::Aqbudget",
397   { budget_id => "budgetid" },
398   {
399     is_deferrable => 1,
400     join_type     => "LEFT",
401     on_delete     => "SET NULL",
402     on_update     => "CASCADE",
403   },
404 );
405
406 =head2 lastmodificationby
407
408 Type: belongs_to
409
410 Related object: L<Koha::Schema::Result::Borrower>
411
412 =cut
413
414 __PACKAGE__->belongs_to(
415   "lastmodificationby",
416   "Koha::Schema::Result::Borrower",
417   { borrowernumber => "lastmodificationby" },
418   {
419     is_deferrable => 1,
420     join_type     => "LEFT",
421     on_delete     => "SET NULL",
422     on_update     => "CASCADE",
423   },
424 );
425
426 =head2 managedby
427
428 Type: belongs_to
429
430 Related object: L<Koha::Schema::Result::Borrower>
431
432 =cut
433
434 __PACKAGE__->belongs_to(
435   "managedby",
436   "Koha::Schema::Result::Borrower",
437   { borrowernumber => "managedby" },
438   {
439     is_deferrable => 1,
440     join_type     => "LEFT",
441     on_delete     => "SET NULL",
442     on_update     => "CASCADE",
443   },
444 );
445
446 =head2 rejectedby
447
448 Type: belongs_to
449
450 Related object: L<Koha::Schema::Result::Borrower>
451
452 =cut
453
454 __PACKAGE__->belongs_to(
455   "rejectedby",
456   "Koha::Schema::Result::Borrower",
457   { borrowernumber => "rejectedby" },
458   {
459     is_deferrable => 1,
460     join_type     => "LEFT",
461     on_delete     => "SET NULL",
462     on_update     => "CASCADE",
463   },
464 );
465
466 =head2 suggestedby
467
468 Type: belongs_to
469
470 Related object: L<Koha::Schema::Result::Borrower>
471
472 =cut
473
474 __PACKAGE__->belongs_to(
475   "suggestedby",
476   "Koha::Schema::Result::Borrower",
477   { borrowernumber => "suggestedby" },
478   {
479     is_deferrable => 1,
480     join_type     => "LEFT",
481     on_delete     => "SET NULL",
482     on_update     => "CASCADE",
483   },
484 );
485
486
487 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-27 06:55:24
488 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:shHAnURjxdagQdgu90WQuw
489
490 __PACKAGE__->belongs_to(
491   "suggester",
492   "Koha::Schema::Result::Borrower",
493   { "foreign.borrowernumber" => "self.suggestedby" },
494   {
495     is_deferrable => 1,
496     join_type     => "LEFT",
497     on_delete     => "SET NULL",
498     on_update     => "CASCADE",
499   },
500 );
501
502 __PACKAGE__->add_columns(
503     '+archived' => { is_boolean => 1 },
504 );
505
506 sub koha_objects_class {
507     'Koha::Suggestions';
508 }
509
510 sub koha_object_class {
511     'Koha::Suggestion';
512 }
513
514 1;