Bug 8798: DBIx::Class base classes for all Koha tables
[koha.git] / Koha / Schema / Result / Biblioitem.pm
1 package Koha::Schema::Result::Biblioitem;
2
3 # Created by DBIx::Class::Schema::Loader
4 # DO NOT MODIFY THE FIRST PART OF THIS FILE
5
6 use strict;
7 use warnings;
8
9 use base 'DBIx::Class::Core';
10
11
12 =head1 NAME
13
14 Koha::Schema::Result::Biblioitem
15
16 =cut
17
18 __PACKAGE__->table("biblioitems");
19
20 =head1 ACCESSORS
21
22 =head2 biblioitemnumber
23
24   data_type: 'integer'
25   is_auto_increment: 1
26   is_nullable: 0
27
28 =head2 biblionumber
29
30   data_type: 'integer'
31   default_value: 0
32   is_foreign_key: 1
33   is_nullable: 0
34
35 =head2 volume
36
37   data_type: 'mediumtext'
38   is_nullable: 1
39
40 =head2 number
41
42   data_type: 'mediumtext'
43   is_nullable: 1
44
45 =head2 itemtype
46
47   data_type: 'varchar'
48   is_nullable: 1
49   size: 10
50
51 =head2 isbn
52
53   data_type: 'varchar'
54   is_nullable: 1
55   size: 30
56
57 =head2 issn
58
59   data_type: 'varchar'
60   is_nullable: 1
61   size: 9
62
63 =head2 ean
64
65   data_type: 'varchar'
66   is_nullable: 1
67   size: 13
68
69 =head2 publicationyear
70
71   data_type: 'text'
72   is_nullable: 1
73
74 =head2 publishercode
75
76   data_type: 'varchar'
77   is_nullable: 1
78   size: 255
79
80 =head2 volumedate
81
82   data_type: 'date'
83   is_nullable: 1
84
85 =head2 volumedesc
86
87   data_type: 'text'
88   is_nullable: 1
89
90 =head2 collectiontitle
91
92   data_type: 'mediumtext'
93   is_nullable: 1
94
95 =head2 collectionissn
96
97   data_type: 'text'
98   is_nullable: 1
99
100 =head2 collectionvolume
101
102   data_type: 'mediumtext'
103   is_nullable: 1
104
105 =head2 editionstatement
106
107   data_type: 'text'
108   is_nullable: 1
109
110 =head2 editionresponsibility
111
112   data_type: 'text'
113   is_nullable: 1
114
115 =head2 timestamp
116
117   data_type: 'timestamp'
118   default_value: current_timestamp
119   is_nullable: 0
120
121 =head2 illus
122
123   data_type: 'varchar'
124   is_nullable: 1
125   size: 255
126
127 =head2 pages
128
129   data_type: 'varchar'
130   is_nullable: 1
131   size: 255
132
133 =head2 notes
134
135   data_type: 'mediumtext'
136   is_nullable: 1
137
138 =head2 size
139
140   data_type: 'varchar'
141   is_nullable: 1
142   size: 255
143
144 =head2 place
145
146   data_type: 'varchar'
147   is_nullable: 1
148   size: 255
149
150 =head2 lccn
151
152   data_type: 'varchar'
153   is_nullable: 1
154   size: 25
155
156 =head2 marc
157
158   data_type: 'longblob'
159   is_nullable: 1
160
161 =head2 url
162
163   data_type: 'varchar'
164   is_nullable: 1
165   size: 255
166
167 =head2 cn_source
168
169   data_type: 'varchar'
170   is_nullable: 1
171   size: 10
172
173 =head2 cn_class
174
175   data_type: 'varchar'
176   is_nullable: 1
177   size: 30
178
179 =head2 cn_item
180
181   data_type: 'varchar'
182   is_nullable: 1
183   size: 10
184
185 =head2 cn_suffix
186
187   data_type: 'varchar'
188   is_nullable: 1
189   size: 10
190
191 =head2 cn_sort
192
193   data_type: 'varchar'
194   is_nullable: 1
195   size: 30
196
197 =head2 agerestriction
198
199   data_type: 'varchar'
200   is_nullable: 1
201   size: 255
202
203 =head2 totalissues
204
205   data_type: 'integer'
206   is_nullable: 1
207
208 =head2 marcxml
209
210   data_type: 'longtext'
211   is_nullable: 0
212
213 =cut
214
215 __PACKAGE__->add_columns(
216   "biblioitemnumber",
217   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
218   "biblionumber",
219   {
220     data_type      => "integer",
221     default_value  => 0,
222     is_foreign_key => 1,
223     is_nullable    => 0,
224   },
225   "volume",
226   { data_type => "mediumtext", is_nullable => 1 },
227   "number",
228   { data_type => "mediumtext", is_nullable => 1 },
229   "itemtype",
230   { data_type => "varchar", is_nullable => 1, size => 10 },
231   "isbn",
232   { data_type => "varchar", is_nullable => 1, size => 30 },
233   "issn",
234   { data_type => "varchar", is_nullable => 1, size => 9 },
235   "ean",
236   { data_type => "varchar", is_nullable => 1, size => 13 },
237   "publicationyear",
238   { data_type => "text", is_nullable => 1 },
239   "publishercode",
240   { data_type => "varchar", is_nullable => 1, size => 255 },
241   "volumedate",
242   { data_type => "date", is_nullable => 1 },
243   "volumedesc",
244   { data_type => "text", is_nullable => 1 },
245   "collectiontitle",
246   { data_type => "mediumtext", is_nullable => 1 },
247   "collectionissn",
248   { data_type => "text", is_nullable => 1 },
249   "collectionvolume",
250   { data_type => "mediumtext", is_nullable => 1 },
251   "editionstatement",
252   { data_type => "text", is_nullable => 1 },
253   "editionresponsibility",
254   { data_type => "text", is_nullable => 1 },
255   "timestamp",
256   {
257     data_type     => "timestamp",
258     default_value => \"current_timestamp",
259     is_nullable   => 0,
260   },
261   "illus",
262   { data_type => "varchar", is_nullable => 1, size => 255 },
263   "pages",
264   { data_type => "varchar", is_nullable => 1, size => 255 },
265   "notes",
266   { data_type => "mediumtext", is_nullable => 1 },
267   "size",
268   { data_type => "varchar", is_nullable => 1, size => 255 },
269   "place",
270   { data_type => "varchar", is_nullable => 1, size => 255 },
271   "lccn",
272   { data_type => "varchar", is_nullable => 1, size => 25 },
273   "marc",
274   { data_type => "longblob", is_nullable => 1 },
275   "url",
276   { data_type => "varchar", is_nullable => 1, size => 255 },
277   "cn_source",
278   { data_type => "varchar", is_nullable => 1, size => 10 },
279   "cn_class",
280   { data_type => "varchar", is_nullable => 1, size => 30 },
281   "cn_item",
282   { data_type => "varchar", is_nullable => 1, size => 10 },
283   "cn_suffix",
284   { data_type => "varchar", is_nullable => 1, size => 10 },
285   "cn_sort",
286   { data_type => "varchar", is_nullable => 1, size => 30 },
287   "agerestriction",
288   { data_type => "varchar", is_nullable => 1, size => 255 },
289   "totalissues",
290   { data_type => "integer", is_nullable => 1 },
291   "marcxml",
292   { data_type => "longtext", is_nullable => 0 },
293 );
294 __PACKAGE__->set_primary_key("biblioitemnumber");
295
296 =head1 RELATIONS
297
298 =head2 biblionumber
299
300 Type: belongs_to
301
302 Related object: L<Koha::Schema::Result::Biblio>
303
304 =cut
305
306 __PACKAGE__->belongs_to(
307   "biblionumber",
308   "Koha::Schema::Result::Biblio",
309   { biblionumber => "biblionumber" },
310   { on_delete => "CASCADE", on_update => "CASCADE" },
311 );
312
313 =head2 items
314
315 Type: has_many
316
317 Related object: L<Koha::Schema::Result::Item>
318
319 =cut
320
321 __PACKAGE__->has_many(
322   "items",
323   "Koha::Schema::Result::Item",
324   { "foreign.biblioitemnumber" => "self.biblioitemnumber" },
325   { cascade_copy => 0, cascade_delete => 0 },
326 );
327
328
329 # Created by DBIx::Class::Schema::Loader v0.07000 @ 2012-09-02 08:44:15
330 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:j5xMUqTsOxa/ieu7yPnOaA
331
332
333 # You can replace this text with custom content, and it will be preserved on regeneration
334 1;