Filename | /home/vagrant/kohaclone/Koha/Schema/Result/Item.pm |
Statements | Executed 29 statements in 1.40ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 25µs | 28µs | BEGIN@1.1658 | Class::C3::Componentised::
1 | 1 | 1 | 10µs | 72µs | BEGIN@16 | Koha::Schema::Result::Item::
1 | 1 | 1 | 9µs | 18µs | BEGIN@13 | Koha::Schema::Result::Item::
1 | 1 | 1 | 8µs | 15µs | BEGIN@14 | Koha::Schema::Result::Item::
0 | 0 | 0 | 0s | 0s | effective_itemtype | Koha::Schema::Result::Item::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 2 | 71µs | 2 | 32µs | # spent 28µs (25+3) within Class::C3::Componentised::BEGIN@1.1658 which was called:
# once (25µs+3µs) by Class::C3::Componentised::ensure_class_loaded at line 1 # spent 28µs making 1 call to Class::C3::Componentised::BEGIN@1.1658
# spent 3µs making 1 call to utf8::import |
2 | package Koha::Schema::Result::Item; | ||||
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::Item | ||||
10 | |||||
11 | =cut | ||||
12 | |||||
13 | 2 | 46µs | 2 | 26µs | # spent 18µs (9+8) within Koha::Schema::Result::Item::BEGIN@13 which was called:
# once (9µs+8µs) by Class::C3::Componentised::ensure_class_loaded at line 13 # spent 18µs making 1 call to Koha::Schema::Result::Item::BEGIN@13
# spent 8µs making 1 call to strict::import |
14 | 2 | 35µs | 2 | 21µs | # spent 15µs (8+6) within Koha::Schema::Result::Item::BEGIN@14 which was called:
# once (8µs+6µs) by Class::C3::Componentised::ensure_class_loaded at line 14 # spent 15µs making 1 call to Koha::Schema::Result::Item::BEGIN@14
# spent 6µs making 1 call to warnings::import |
15 | |||||
16 | 2 | 957µs | 2 | 134µs | # spent 72µs (10+62) within Koha::Schema::Result::Item::BEGIN@16 which was called:
# once (10µs+62µs) by Class::C3::Componentised::ensure_class_loaded at line 16 # spent 72µs making 1 call to Koha::Schema::Result::Item::BEGIN@16
# spent 62µs making 1 call to base::import |
17 | |||||
18 | =head1 TABLE: C<items> | ||||
19 | |||||
20 | =cut | ||||
21 | |||||
22 | 1 | 22µs | 1 | 440µs | __PACKAGE__->table("items"); # spent 440µs making 1 call to DBIx::Class::ResultSourceProxy::Table::table |
23 | |||||
24 | =head1 ACCESSORS | ||||
25 | |||||
26 | =head2 itemnumber | ||||
27 | |||||
28 | data_type: 'integer' | ||||
29 | is_auto_increment: 1 | ||||
30 | is_nullable: 0 | ||||
31 | |||||
32 | =head2 biblionumber | ||||
33 | |||||
34 | data_type: 'integer' | ||||
35 | default_value: 0 | ||||
36 | is_nullable: 0 | ||||
37 | |||||
38 | =head2 biblioitemnumber | ||||
39 | |||||
40 | data_type: 'integer' | ||||
41 | default_value: 0 | ||||
42 | is_foreign_key: 1 | ||||
43 | is_nullable: 0 | ||||
44 | |||||
45 | =head2 barcode | ||||
46 | |||||
47 | data_type: 'varchar' | ||||
48 | is_nullable: 1 | ||||
49 | size: 20 | ||||
50 | |||||
51 | =head2 dateaccessioned | ||||
52 | |||||
53 | data_type: 'date' | ||||
54 | datetime_undef_if_invalid: 1 | ||||
55 | is_nullable: 1 | ||||
56 | |||||
57 | =head2 booksellerid | ||||
58 | |||||
59 | data_type: 'mediumtext' | ||||
60 | is_nullable: 1 | ||||
61 | |||||
62 | =head2 homebranch | ||||
63 | |||||
64 | data_type: 'varchar' | ||||
65 | is_foreign_key: 1 | ||||
66 | is_nullable: 1 | ||||
67 | size: 10 | ||||
68 | |||||
69 | =head2 price | ||||
70 | |||||
71 | data_type: 'decimal' | ||||
72 | is_nullable: 1 | ||||
73 | size: [8,2] | ||||
74 | |||||
75 | =head2 replacementprice | ||||
76 | |||||
77 | data_type: 'decimal' | ||||
78 | is_nullable: 1 | ||||
79 | size: [8,2] | ||||
80 | |||||
81 | =head2 replacementpricedate | ||||
82 | |||||
83 | data_type: 'date' | ||||
84 | datetime_undef_if_invalid: 1 | ||||
85 | is_nullable: 1 | ||||
86 | |||||
87 | =head2 datelastborrowed | ||||
88 | |||||
89 | data_type: 'date' | ||||
90 | datetime_undef_if_invalid: 1 | ||||
91 | is_nullable: 1 | ||||
92 | |||||
93 | =head2 datelastseen | ||||
94 | |||||
95 | data_type: 'date' | ||||
96 | datetime_undef_if_invalid: 1 | ||||
97 | is_nullable: 1 | ||||
98 | |||||
99 | =head2 stack | ||||
100 | |||||
101 | data_type: 'tinyint' | ||||
102 | is_nullable: 1 | ||||
103 | |||||
104 | =head2 notforloan | ||||
105 | |||||
106 | data_type: 'tinyint' | ||||
107 | default_value: 0 | ||||
108 | is_nullable: 0 | ||||
109 | |||||
110 | =head2 damaged | ||||
111 | |||||
112 | data_type: 'tinyint' | ||||
113 | default_value: 0 | ||||
114 | is_nullable: 0 | ||||
115 | |||||
116 | =head2 itemlost | ||||
117 | |||||
118 | data_type: 'tinyint' | ||||
119 | default_value: 0 | ||||
120 | is_nullable: 0 | ||||
121 | |||||
122 | =head2 itemlost_on | ||||
123 | |||||
124 | data_type: 'datetime' | ||||
125 | datetime_undef_if_invalid: 1 | ||||
126 | is_nullable: 1 | ||||
127 | |||||
128 | =head2 withdrawn | ||||
129 | |||||
130 | data_type: 'tinyint' | ||||
131 | default_value: 0 | ||||
132 | is_nullable: 0 | ||||
133 | |||||
134 | =head2 withdrawn_on | ||||
135 | |||||
136 | data_type: 'datetime' | ||||
137 | datetime_undef_if_invalid: 1 | ||||
138 | is_nullable: 1 | ||||
139 | |||||
140 | =head2 itemcallnumber | ||||
141 | |||||
142 | data_type: 'varchar' | ||||
143 | is_nullable: 1 | ||||
144 | size: 255 | ||||
145 | |||||
146 | =head2 coded_location_qualifier | ||||
147 | |||||
148 | data_type: 'varchar' | ||||
149 | is_nullable: 1 | ||||
150 | size: 10 | ||||
151 | |||||
152 | =head2 issues | ||||
153 | |||||
154 | data_type: 'smallint' | ||||
155 | is_nullable: 1 | ||||
156 | |||||
157 | =head2 renewals | ||||
158 | |||||
159 | data_type: 'smallint' | ||||
160 | is_nullable: 1 | ||||
161 | |||||
162 | =head2 reserves | ||||
163 | |||||
164 | data_type: 'smallint' | ||||
165 | is_nullable: 1 | ||||
166 | |||||
167 | =head2 restricted | ||||
168 | |||||
169 | data_type: 'tinyint' | ||||
170 | is_nullable: 1 | ||||
171 | |||||
172 | =head2 itemnotes | ||||
173 | |||||
174 | data_type: 'mediumtext' | ||||
175 | is_nullable: 1 | ||||
176 | |||||
177 | =head2 itemnotes_nonpublic | ||||
178 | |||||
179 | data_type: 'mediumtext' | ||||
180 | is_nullable: 1 | ||||
181 | |||||
182 | =head2 holdingbranch | ||||
183 | |||||
184 | data_type: 'varchar' | ||||
185 | is_foreign_key: 1 | ||||
186 | is_nullable: 1 | ||||
187 | size: 10 | ||||
188 | |||||
189 | =head2 paidfor | ||||
190 | |||||
191 | data_type: 'mediumtext' | ||||
192 | is_nullable: 1 | ||||
193 | |||||
194 | =head2 timestamp | ||||
195 | |||||
196 | data_type: 'timestamp' | ||||
197 | datetime_undef_if_invalid: 1 | ||||
198 | default_value: current_timestamp | ||||
199 | is_nullable: 0 | ||||
200 | |||||
201 | =head2 location | ||||
202 | |||||
203 | data_type: 'varchar' | ||||
204 | is_nullable: 1 | ||||
205 | size: 80 | ||||
206 | |||||
207 | =head2 permanent_location | ||||
208 | |||||
209 | data_type: 'varchar' | ||||
210 | is_nullable: 1 | ||||
211 | size: 80 | ||||
212 | |||||
213 | =head2 onloan | ||||
214 | |||||
215 | data_type: 'date' | ||||
216 | datetime_undef_if_invalid: 1 | ||||
217 | is_nullable: 1 | ||||
218 | |||||
219 | =head2 cn_source | ||||
220 | |||||
221 | data_type: 'varchar' | ||||
222 | is_nullable: 1 | ||||
223 | size: 10 | ||||
224 | |||||
225 | =head2 cn_sort | ||||
226 | |||||
227 | data_type: 'varchar' | ||||
228 | is_nullable: 1 | ||||
229 | size: 255 | ||||
230 | |||||
231 | =head2 ccode | ||||
232 | |||||
233 | data_type: 'varchar' | ||||
234 | is_nullable: 1 | ||||
235 | size: 10 | ||||
236 | |||||
237 | =head2 materials | ||||
238 | |||||
239 | data_type: 'text' | ||||
240 | is_nullable: 1 | ||||
241 | |||||
242 | =head2 uri | ||||
243 | |||||
244 | data_type: 'varchar' | ||||
245 | is_nullable: 1 | ||||
246 | size: 255 | ||||
247 | |||||
248 | =head2 itype | ||||
249 | |||||
250 | data_type: 'varchar' | ||||
251 | is_nullable: 1 | ||||
252 | size: 10 | ||||
253 | |||||
254 | =head2 more_subfields_xml | ||||
255 | |||||
256 | data_type: 'longtext' | ||||
257 | is_nullable: 1 | ||||
258 | |||||
259 | =head2 enumchron | ||||
260 | |||||
261 | data_type: 'text' | ||||
262 | is_nullable: 1 | ||||
263 | |||||
264 | =head2 copynumber | ||||
265 | |||||
266 | data_type: 'varchar' | ||||
267 | is_nullable: 1 | ||||
268 | size: 32 | ||||
269 | |||||
270 | =head2 stocknumber | ||||
271 | |||||
272 | data_type: 'varchar' | ||||
273 | is_nullable: 1 | ||||
274 | size: 32 | ||||
275 | |||||
276 | =cut | ||||
277 | |||||
278 | 1 | 80µs | 1 | 18.5ms | __PACKAGE__->add_columns( # spent 18.5ms making 1 call to DBIx::Class::ResultSourceProxy::add_columns |
279 | "itemnumber", | ||||
280 | { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, | ||||
281 | "biblionumber", | ||||
282 | { data_type => "integer", default_value => 0, is_nullable => 0 }, | ||||
283 | "biblioitemnumber", | ||||
284 | { | ||||
285 | data_type => "integer", | ||||
286 | default_value => 0, | ||||
287 | is_foreign_key => 1, | ||||
288 | is_nullable => 0, | ||||
289 | }, | ||||
290 | "barcode", | ||||
291 | { data_type => "varchar", is_nullable => 1, size => 20 }, | ||||
292 | "dateaccessioned", | ||||
293 | { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, | ||||
294 | "booksellerid", | ||||
295 | { data_type => "mediumtext", is_nullable => 1 }, | ||||
296 | "homebranch", | ||||
297 | { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, | ||||
298 | "price", | ||||
299 | { data_type => "decimal", is_nullable => 1, size => [8, 2] }, | ||||
300 | "replacementprice", | ||||
301 | { data_type => "decimal", is_nullable => 1, size => [8, 2] }, | ||||
302 | "replacementpricedate", | ||||
303 | { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, | ||||
304 | "datelastborrowed", | ||||
305 | { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, | ||||
306 | "datelastseen", | ||||
307 | { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, | ||||
308 | "stack", | ||||
309 | { data_type => "tinyint", is_nullable => 1 }, | ||||
310 | "notforloan", | ||||
311 | { data_type => "tinyint", default_value => 0, is_nullable => 0 }, | ||||
312 | "damaged", | ||||
313 | { data_type => "tinyint", default_value => 0, is_nullable => 0 }, | ||||
314 | "itemlost", | ||||
315 | { data_type => "tinyint", default_value => 0, is_nullable => 0 }, | ||||
316 | "itemlost_on", | ||||
317 | { | ||||
318 | data_type => "datetime", | ||||
319 | datetime_undef_if_invalid => 1, | ||||
320 | is_nullable => 1, | ||||
321 | }, | ||||
322 | "withdrawn", | ||||
323 | { data_type => "tinyint", default_value => 0, is_nullable => 0 }, | ||||
324 | "withdrawn_on", | ||||
325 | { | ||||
326 | data_type => "datetime", | ||||
327 | datetime_undef_if_invalid => 1, | ||||
328 | is_nullable => 1, | ||||
329 | }, | ||||
330 | "itemcallnumber", | ||||
331 | { data_type => "varchar", is_nullable => 1, size => 255 }, | ||||
332 | "coded_location_qualifier", | ||||
333 | { data_type => "varchar", is_nullable => 1, size => 10 }, | ||||
334 | "issues", | ||||
335 | { data_type => "smallint", is_nullable => 1 }, | ||||
336 | "renewals", | ||||
337 | { data_type => "smallint", is_nullable => 1 }, | ||||
338 | "reserves", | ||||
339 | { data_type => "smallint", is_nullable => 1 }, | ||||
340 | "restricted", | ||||
341 | { data_type => "tinyint", is_nullable => 1 }, | ||||
342 | "itemnotes", | ||||
343 | { data_type => "mediumtext", is_nullable => 1 }, | ||||
344 | "itemnotes_nonpublic", | ||||
345 | { data_type => "mediumtext", is_nullable => 1 }, | ||||
346 | "holdingbranch", | ||||
347 | { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, | ||||
348 | "paidfor", | ||||
349 | { data_type => "mediumtext", is_nullable => 1 }, | ||||
350 | "timestamp", | ||||
351 | { | ||||
352 | data_type => "timestamp", | ||||
353 | datetime_undef_if_invalid => 1, | ||||
354 | default_value => \"current_timestamp", | ||||
355 | is_nullable => 0, | ||||
356 | }, | ||||
357 | "location", | ||||
358 | { data_type => "varchar", is_nullable => 1, size => 80 }, | ||||
359 | "permanent_location", | ||||
360 | { data_type => "varchar", is_nullable => 1, size => 80 }, | ||||
361 | "onloan", | ||||
362 | { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, | ||||
363 | "cn_source", | ||||
364 | { data_type => "varchar", is_nullable => 1, size => 10 }, | ||||
365 | "cn_sort", | ||||
366 | { data_type => "varchar", is_nullable => 1, size => 255 }, | ||||
367 | "ccode", | ||||
368 | { data_type => "varchar", is_nullable => 1, size => 10 }, | ||||
369 | "materials", | ||||
370 | { data_type => "text", is_nullable => 1 }, | ||||
371 | "uri", | ||||
372 | { data_type => "varchar", is_nullable => 1, size => 255 }, | ||||
373 | "itype", | ||||
374 | { data_type => "varchar", is_nullable => 1, size => 10 }, | ||||
375 | "more_subfields_xml", | ||||
376 | { data_type => "longtext", is_nullable => 1 }, | ||||
377 | "enumchron", | ||||
378 | { data_type => "text", is_nullable => 1 }, | ||||
379 | "copynumber", | ||||
380 | { data_type => "varchar", is_nullable => 1, size => 32 }, | ||||
381 | "stocknumber", | ||||
382 | { data_type => "varchar", is_nullable => 1, size => 32 }, | ||||
383 | ); | ||||
384 | |||||
385 | =head1 PRIMARY KEY | ||||
386 | |||||
387 | =over 4 | ||||
388 | |||||
389 | =item * L</itemnumber> | ||||
390 | |||||
391 | =back | ||||
392 | |||||
393 | =cut | ||||
394 | |||||
395 | 1 | 18µs | 1 | 102µs | __PACKAGE__->set_primary_key("itemnumber"); # spent 102µs making 1 call to DBIx::Class::ResultSourceProxy::set_primary_key |
396 | |||||
397 | =head1 UNIQUE CONSTRAINTS | ||||
398 | |||||
399 | =head2 C<itembarcodeidx> | ||||
400 | |||||
401 | =over 4 | ||||
402 | |||||
403 | =item * L</barcode> | ||||
404 | |||||
405 | =back | ||||
406 | |||||
407 | =cut | ||||
408 | |||||
409 | 1 | 18µs | 1 | 26µs | __PACKAGE__->add_unique_constraint("itembarcodeidx", ["barcode"]); # spent 26µs making 1 call to DBIx::Class::ResultSourceProxy::add_unique_constraint |
410 | |||||
411 | =head1 RELATIONS | ||||
412 | |||||
413 | =head2 accountlines | ||||
414 | |||||
415 | Type: has_many | ||||
416 | |||||
417 | Related object: L<Koha::Schema::Result::Accountline> | ||||
418 | |||||
419 | =cut | ||||
420 | |||||
421 | 1 | 10µs | 1 | 438µs | __PACKAGE__->has_many( # spent 438µs making 1 call to DBIx::Class::Relationship::HasMany::has_many |
422 | "accountlines", | ||||
423 | "Koha::Schema::Result::Accountline", | ||||
424 | { "foreign.itemnumber" => "self.itemnumber" }, | ||||
425 | { cascade_copy => 0, cascade_delete => 0 }, | ||||
426 | ); | ||||
427 | |||||
428 | =head2 biblioitemnumber | ||||
429 | |||||
430 | Type: belongs_to | ||||
431 | |||||
432 | Related object: L<Koha::Schema::Result::Biblioitem> | ||||
433 | |||||
434 | =cut | ||||
435 | |||||
436 | 1 | 10µs | 1 | 944µs | __PACKAGE__->belongs_to( # spent 944µs making 1 call to DBIx::Class::Relationship::BelongsTo::belongs_to |
437 | "biblioitemnumber", | ||||
438 | "Koha::Schema::Result::Biblioitem", | ||||
439 | { biblioitemnumber => "biblioitemnumber" }, | ||||
440 | { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, | ||||
441 | ); | ||||
442 | |||||
443 | =head2 branchtransfers | ||||
444 | |||||
445 | Type: has_many | ||||
446 | |||||
447 | Related object: L<Koha::Schema::Result::Branchtransfer> | ||||
448 | |||||
449 | =cut | ||||
450 | |||||
451 | 1 | 8µs | 1 | 268µs | __PACKAGE__->has_many( # spent 268µs making 1 call to DBIx::Class::Relationship::HasMany::has_many |
452 | "branchtransfers", | ||||
453 | "Koha::Schema::Result::Branchtransfer", | ||||
454 | { "foreign.itemnumber" => "self.itemnumber" }, | ||||
455 | { cascade_copy => 0, cascade_delete => 0 }, | ||||
456 | ); | ||||
457 | |||||
458 | =head2 course_item | ||||
459 | |||||
460 | Type: might_have | ||||
461 | |||||
462 | Related object: L<Koha::Schema::Result::CourseItem> | ||||
463 | |||||
464 | =cut | ||||
465 | |||||
466 | 1 | 9µs | 1 | 230µs | __PACKAGE__->might_have( # spent 230µs making 1 call to DBIx::Class::Relationship::HasOne::might_have |
467 | "course_item", | ||||
468 | "Koha::Schema::Result::CourseItem", | ||||
469 | { "foreign.itemnumber" => "self.itemnumber" }, | ||||
470 | { cascade_copy => 0, cascade_delete => 0 }, | ||||
471 | ); | ||||
472 | |||||
473 | =head2 creator_batches | ||||
474 | |||||
475 | Type: has_many | ||||
476 | |||||
477 | Related object: L<Koha::Schema::Result::CreatorBatch> | ||||
478 | |||||
479 | =cut | ||||
480 | |||||
481 | 1 | 4µs | 1 | 229µs | __PACKAGE__->has_many( # spent 229µs making 1 call to DBIx::Class::Relationship::HasMany::has_many |
482 | "creator_batches", | ||||
483 | "Koha::Schema::Result::CreatorBatch", | ||||
484 | { "foreign.item_number" => "self.itemnumber" }, | ||||
485 | { cascade_copy => 0, cascade_delete => 0 }, | ||||
486 | ); | ||||
487 | |||||
488 | =head2 hold_fill_target | ||||
489 | |||||
490 | Type: might_have | ||||
491 | |||||
492 | Related object: L<Koha::Schema::Result::HoldFillTarget> | ||||
493 | |||||
494 | =cut | ||||
495 | |||||
496 | 1 | 4µs | 1 | 3.75ms | __PACKAGE__->might_have( # spent 3.75ms making 1 call to DBIx::Class::Relationship::HasOne::might_have |
497 | "hold_fill_target", | ||||
498 | "Koha::Schema::Result::HoldFillTarget", | ||||
499 | { "foreign.itemnumber" => "self.itemnumber" }, | ||||
500 | { cascade_copy => 0, cascade_delete => 0 }, | ||||
501 | ); | ||||
502 | |||||
503 | =head2 holdingbranch | ||||
504 | |||||
505 | Type: belongs_to | ||||
506 | |||||
507 | Related object: L<Koha::Schema::Result::Branch> | ||||
508 | |||||
509 | =cut | ||||
510 | |||||
511 | 1 | 11µs | 1 | 290µs | __PACKAGE__->belongs_to( # spent 290µs making 1 call to DBIx::Class::Relationship::BelongsTo::belongs_to |
512 | "holdingbranch", | ||||
513 | "Koha::Schema::Result::Branch", | ||||
514 | { branchcode => "holdingbranch" }, | ||||
515 | { | ||||
516 | is_deferrable => 1, | ||||
517 | join_type => "LEFT", | ||||
518 | on_delete => "RESTRICT", | ||||
519 | on_update => "CASCADE", | ||||
520 | }, | ||||
521 | ); | ||||
522 | |||||
523 | =head2 homebranch | ||||
524 | |||||
525 | Type: belongs_to | ||||
526 | |||||
527 | Related object: L<Koha::Schema::Result::Branch> | ||||
528 | |||||
529 | =cut | ||||
530 | |||||
531 | 1 | 6µs | 1 | 743µs | __PACKAGE__->belongs_to( # spent 743µs making 1 call to DBIx::Class::Relationship::BelongsTo::belongs_to |
532 | "homebranch", | ||||
533 | "Koha::Schema::Result::Branch", | ||||
534 | { branchcode => "homebranch" }, | ||||
535 | { | ||||
536 | is_deferrable => 1, | ||||
537 | join_type => "LEFT", | ||||
538 | on_delete => "RESTRICT", | ||||
539 | on_update => "CASCADE", | ||||
540 | }, | ||||
541 | ); | ||||
542 | |||||
543 | =head2 issue | ||||
544 | |||||
545 | Type: might_have | ||||
546 | |||||
547 | Related object: L<Koha::Schema::Result::Issue> | ||||
548 | |||||
549 | =cut | ||||
550 | |||||
551 | 1 | 7µs | 1 | 278µs | __PACKAGE__->might_have( # spent 278µs making 1 call to DBIx::Class::Relationship::HasOne::might_have |
552 | "issue", | ||||
553 | "Koha::Schema::Result::Issue", | ||||
554 | { "foreign.itemnumber" => "self.itemnumber" }, | ||||
555 | { cascade_copy => 0, cascade_delete => 0 }, | ||||
556 | ); | ||||
557 | |||||
558 | =head2 items_last_borrower | ||||
559 | |||||
560 | Type: might_have | ||||
561 | |||||
562 | Related object: L<Koha::Schema::Result::ItemsLastBorrower> | ||||
563 | |||||
564 | =cut | ||||
565 | |||||
566 | 1 | 4µs | 1 | 162µs | __PACKAGE__->might_have( # spent 162µs making 1 call to DBIx::Class::Relationship::HasOne::might_have |
567 | "items_last_borrower", | ||||
568 | "Koha::Schema::Result::ItemsLastBorrower", | ||||
569 | { "foreign.itemnumber" => "self.itemnumber" }, | ||||
570 | { cascade_copy => 0, cascade_delete => 0 }, | ||||
571 | ); | ||||
572 | |||||
573 | =head2 old_issues | ||||
574 | |||||
575 | Type: has_many | ||||
576 | |||||
577 | Related object: L<Koha::Schema::Result::OldIssue> | ||||
578 | |||||
579 | =cut | ||||
580 | |||||
581 | 1 | 7µs | 1 | 211µs | __PACKAGE__->has_many( # spent 211µs making 1 call to DBIx::Class::Relationship::HasMany::has_many |
582 | "old_issues", | ||||
583 | "Koha::Schema::Result::OldIssue", | ||||
584 | { "foreign.itemnumber" => "self.itemnumber" }, | ||||
585 | { cascade_copy => 0, cascade_delete => 0 }, | ||||
586 | ); | ||||
587 | |||||
588 | =head2 old_reserves | ||||
589 | |||||
590 | Type: has_many | ||||
591 | |||||
592 | Related object: L<Koha::Schema::Result::OldReserve> | ||||
593 | |||||
594 | =cut | ||||
595 | |||||
596 | 1 | 4µs | 1 | 217µs | __PACKAGE__->has_many( # spent 217µs making 1 call to DBIx::Class::Relationship::HasMany::has_many |
597 | "old_reserves", | ||||
598 | "Koha::Schema::Result::OldReserve", | ||||
599 | { "foreign.itemnumber" => "self.itemnumber" }, | ||||
600 | { cascade_copy => 0, cascade_delete => 0 }, | ||||
601 | ); | ||||
602 | |||||
603 | =head2 reserves | ||||
604 | |||||
605 | Type: has_many | ||||
606 | |||||
607 | Related object: L<Koha::Schema::Result::Reserve> | ||||
608 | |||||
609 | =cut | ||||
610 | |||||
611 | 1 | 4µs | 1 | 218µs | __PACKAGE__->has_many( # spent 218µs making 1 call to DBIx::Class::Relationship::HasMany::has_many |
612 | "reserves", | ||||
613 | "Koha::Schema::Result::Reserve", | ||||
614 | { "foreign.itemnumber" => "self.itemnumber" }, | ||||
615 | { cascade_copy => 0, cascade_delete => 0 }, | ||||
616 | ); | ||||
617 | |||||
618 | =head2 serialitem | ||||
619 | |||||
620 | Type: might_have | ||||
621 | |||||
622 | Related object: L<Koha::Schema::Result::Serialitem> | ||||
623 | |||||
624 | =cut | ||||
625 | |||||
626 | 1 | 4µs | 1 | 159µs | __PACKAGE__->might_have( # spent 159µs making 1 call to DBIx::Class::Relationship::HasOne::might_have |
627 | "serialitem", | ||||
628 | "Koha::Schema::Result::Serialitem", | ||||
629 | { "foreign.itemnumber" => "self.itemnumber" }, | ||||
630 | { cascade_copy => 0, cascade_delete => 0 }, | ||||
631 | ); | ||||
632 | |||||
633 | |||||
634 | # Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-01-06 12:00:28 | ||||
635 | # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3M6BvB4ATsBXgQCkFKuI3A | ||||
636 | |||||
637 | 1 | 5µs | 1 | 6.10ms | __PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" ); # spent 6.10ms making 1 call to DBIx::Class::Relationship::BelongsTo::belongs_to |
638 | |||||
639 | 1 | 8µs | 1 | 151µs | __PACKAGE__->belongs_to( # spent 151µs making 1 call to DBIx::Class::Relationship::BelongsTo::belongs_to |
640 | "biblio", | ||||
641 | "Koha::Schema::Result::Biblio", | ||||
642 | { biblionumber => "biblionumber" }, | ||||
643 | { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, | ||||
644 | ); | ||||
645 | |||||
646 | sub effective_itemtype { | ||||
647 | my ( $self ) = @_; | ||||
648 | |||||
649 | my $pref = $self->result_source->schema->resultset('Systempreference')->find('item-level_itypes'); | ||||
650 | if ( $pref->value() && $self->itype() ) { | ||||
651 | return $self->itype(); | ||||
652 | } else { | ||||
653 | warn "item-level_itypes set but no itemtype set for item ($self->itemnumber)" | ||||
654 | if $pref->value(); | ||||
655 | return $self->biblioitemnumber()->itemtype(); | ||||
656 | } | ||||
657 | } | ||||
658 | |||||
659 | 1 | 51µs | 1; |