Bug 24418: Add koha_object(s)_class methods to Suggestion
[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 STATUS
81
82   accessor: 'status'
83   data_type: 'varchar'
84   default_value: (empty string)
85   is_nullable: 0
86   size: 10
87
88 =head2 note
89
90   data_type: 'longtext'
91   is_nullable: 1
92
93 =head2 author
94
95   data_type: 'varchar'
96   is_nullable: 1
97   size: 80
98
99 =head2 title
100
101   data_type: 'varchar'
102   is_nullable: 1
103   size: 255
104
105 =head2 copyrightdate
106
107   data_type: 'smallint'
108   is_nullable: 1
109
110 =head2 publishercode
111
112   data_type: 'varchar'
113   is_nullable: 1
114   size: 255
115
116 =head2 date
117
118   data_type: 'timestamp'
119   datetime_undef_if_invalid: 1
120   default_value: current_timestamp
121   is_nullable: 0
122
123 =head2 volumedesc
124
125   data_type: 'varchar'
126   is_nullable: 1
127   size: 255
128
129 =head2 publicationyear
130
131   data_type: 'smallint'
132   default_value: 0
133   is_nullable: 1
134
135 =head2 place
136
137   data_type: 'varchar'
138   is_nullable: 1
139   size: 255
140
141 =head2 isbn
142
143   data_type: 'varchar'
144   is_nullable: 1
145   size: 30
146
147 =head2 biblionumber
148
149   data_type: 'integer'
150   is_foreign_key: 1
151   is_nullable: 1
152
153 =head2 reason
154
155   data_type: 'mediumtext'
156   is_nullable: 1
157
158 =head2 patronreason
159
160   data_type: 'mediumtext'
161   is_nullable: 1
162
163 =head2 budgetid
164
165   data_type: 'integer'
166   is_foreign_key: 1
167   is_nullable: 1
168
169 =head2 branchcode
170
171   data_type: 'varchar'
172   is_foreign_key: 1
173   is_nullable: 1
174   size: 10
175
176 =head2 collectiontitle
177
178   data_type: 'mediumtext'
179   is_nullable: 1
180
181 =head2 itemtype
182
183   data_type: 'varchar'
184   is_nullable: 1
185   size: 30
186
187 =head2 quantity
188
189   data_type: 'smallint'
190   is_nullable: 1
191
192 =head2 currency
193
194   data_type: 'varchar'
195   is_nullable: 1
196   size: 10
197
198 =head2 price
199
200   data_type: 'decimal'
201   is_nullable: 1
202   size: [28,6]
203
204 =head2 total
205
206   data_type: 'decimal'
207   is_nullable: 1
208   size: [28,6]
209
210 =cut
211
212 __PACKAGE__->add_columns(
213   "suggestionid",
214   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
215   "suggestedby",
216   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
217   "suggesteddate",
218   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 },
219   "managedby",
220   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
221   "manageddate",
222   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
223   "acceptedby",
224   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
225   "accepteddate",
226   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
227   "rejectedby",
228   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
229   "rejecteddate",
230   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
231   "STATUS",
232   {
233     accessor => "status",
234     data_type => "varchar",
235     default_value => "",
236     is_nullable => 0,
237     size => 10,
238   },
239   "note",
240   { data_type => "longtext", is_nullable => 1 },
241   "author",
242   { data_type => "varchar", is_nullable => 1, size => 80 },
243   "title",
244   { data_type => "varchar", is_nullable => 1, size => 255 },
245   "copyrightdate",
246   { data_type => "smallint", is_nullable => 1 },
247   "publishercode",
248   { data_type => "varchar", is_nullable => 1, size => 255 },
249   "date",
250   {
251     data_type => "timestamp",
252     datetime_undef_if_invalid => 1,
253     default_value => \"current_timestamp",
254     is_nullable => 0,
255   },
256   "volumedesc",
257   { data_type => "varchar", is_nullable => 1, size => 255 },
258   "publicationyear",
259   { data_type => "smallint", default_value => 0, is_nullable => 1 },
260   "place",
261   { data_type => "varchar", is_nullable => 1, size => 255 },
262   "isbn",
263   { data_type => "varchar", is_nullable => 1, size => 30 },
264   "biblionumber",
265   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
266   "reason",
267   { data_type => "mediumtext", is_nullable => 1 },
268   "patronreason",
269   { data_type => "mediumtext", is_nullable => 1 },
270   "budgetid",
271   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
272   "branchcode",
273   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
274   "collectiontitle",
275   { data_type => "mediumtext", is_nullable => 1 },
276   "itemtype",
277   { data_type => "varchar", is_nullable => 1, size => 30 },
278   "quantity",
279   { data_type => "smallint", is_nullable => 1 },
280   "currency",
281   { data_type => "varchar", is_nullable => 1, size => 10 },
282   "price",
283   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
284   "total",
285   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
286 );
287
288 =head1 PRIMARY KEY
289
290 =over 4
291
292 =item * L</suggestionid>
293
294 =back
295
296 =cut
297
298 __PACKAGE__->set_primary_key("suggestionid");
299
300 =head1 RELATIONS
301
302 =head2 acceptedby
303
304 Type: belongs_to
305
306 Related object: L<Koha::Schema::Result::Borrower>
307
308 =cut
309
310 __PACKAGE__->belongs_to(
311   "acceptedby",
312   "Koha::Schema::Result::Borrower",
313   { borrowernumber => "acceptedby" },
314   {
315     is_deferrable => 1,
316     join_type     => "LEFT",
317     on_delete     => "SET NULL",
318     on_update     => "CASCADE",
319   },
320 );
321
322 =head2 biblionumber
323
324 Type: belongs_to
325
326 Related object: L<Koha::Schema::Result::Biblio>
327
328 =cut
329
330 __PACKAGE__->belongs_to(
331   "biblionumber",
332   "Koha::Schema::Result::Biblio",
333   { biblionumber => "biblionumber" },
334   {
335     is_deferrable => 1,
336     join_type     => "LEFT",
337     on_delete     => "SET NULL",
338     on_update     => "CASCADE",
339   },
340 );
341
342 =head2 branchcode
343
344 Type: belongs_to
345
346 Related object: L<Koha::Schema::Result::Branch>
347
348 =cut
349
350 __PACKAGE__->belongs_to(
351   "branchcode",
352   "Koha::Schema::Result::Branch",
353   { branchcode => "branchcode" },
354   {
355     is_deferrable => 1,
356     join_type     => "LEFT",
357     on_delete     => "SET NULL",
358     on_update     => "CASCADE",
359   },
360 );
361
362 =head2 budgetid
363
364 Type: belongs_to
365
366 Related object: L<Koha::Schema::Result::Aqbudget>
367
368 =cut
369
370 __PACKAGE__->belongs_to(
371   "budgetid",
372   "Koha::Schema::Result::Aqbudget",
373   { budget_id => "budgetid" },
374   {
375     is_deferrable => 1,
376     join_type     => "LEFT",
377     on_delete     => "SET NULL",
378     on_update     => "CASCADE",
379   },
380 );
381
382 =head2 managedby
383
384 Type: belongs_to
385
386 Related object: L<Koha::Schema::Result::Borrower>
387
388 =cut
389
390 __PACKAGE__->belongs_to(
391   "managedby",
392   "Koha::Schema::Result::Borrower",
393   { borrowernumber => "managedby" },
394   {
395     is_deferrable => 1,
396     join_type     => "LEFT",
397     on_delete     => "SET NULL",
398     on_update     => "CASCADE",
399   },
400 );
401
402 =head2 rejectedby
403
404 Type: belongs_to
405
406 Related object: L<Koha::Schema::Result::Borrower>
407
408 =cut
409
410 __PACKAGE__->belongs_to(
411   "rejectedby",
412   "Koha::Schema::Result::Borrower",
413   { borrowernumber => "rejectedby" },
414   {
415     is_deferrable => 1,
416     join_type     => "LEFT",
417     on_delete     => "SET NULL",
418     on_update     => "CASCADE",
419   },
420 );
421
422 =head2 suggestedby
423
424 Type: belongs_to
425
426 Related object: L<Koha::Schema::Result::Borrower>
427
428 =cut
429
430 __PACKAGE__->belongs_to(
431   "suggestedby",
432   "Koha::Schema::Result::Borrower",
433   { borrowernumber => "suggestedby" },
434   {
435     is_deferrable => 1,
436     join_type     => "LEFT",
437     on_delete     => "SET NULL",
438     on_update     => "CASCADE",
439   },
440 );
441
442
443 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-03-11 12:56:41
444 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UsG/gxLa0HMMbcpbscV29Q
445
446 sub koha_objects_class {
447     'Koha::Suggestions';
448 }
449
450 sub koha_object_class {
451     'Koha::Suggestion';
452 }
453
454 1;