← Index
NYTProf Performance Profile   « line view »
For starman worker -M FindBin --max-requests 50 --workers 2 --user=kohadev-koha --group kohadev-koha --pid /var/run/koha/kohadev/plack.pid --daemonize --access-log /var/log/koha/kohadev/plack.log --error-log /var/log/koha/kohadev/plack-error.log -E deployment --socket /var/run/koha/kohadev/plack.sock /etc/koha/sites/kohadev/plack.psgi
  Run on Fri Jan 8 14:16:49 2016
Reported on Fri Jan 8 14:23:08 2016

Filename/home/vagrant/kohaclone/Koha/Schema/Result/Item.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11171µs84µsClass::C3::Componentised::::BEGIN@1.950 Class::C3::Componentised::BEGIN@1.950
11130µs45µsKoha::Schema::Result::Item::::BEGIN@13Koha::Schema::Result::Item::BEGIN@13
11126µs97µsKoha::Schema::Result::Item::::BEGIN@16Koha::Schema::Result::Item::BEGIN@16
11120µs31µsKoha::Schema::Result::Item::::BEGIN@14Koha::Schema::Result::Item::BEGIN@14
0000s0sKoha::Schema::Result::Item::::effective_itemtypeKoha::Schema::Result::Item::effective_itemtype
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1297µs
# spent 84µs (71+13) within Class::C3::Componentised::BEGIN@1.950 which was called: # once (71µs+13µs) by Class::C3::Componentised::ensure_class_loaded at line 1
use utf8;
# spent 84µs making 1 call to Class::C3::Componentised::BEGIN@1.950 # spent 13µs making 1 call to utf8::import
2package 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
9Koha::Schema::Result::Item
10
11=cut
12
13260µs
# spent 45µs (30+15) within Koha::Schema::Result::Item::BEGIN@13 which was called: # once (30µs+15µs) by Class::C3::Componentised::ensure_class_loaded at line 13
use strict;
# spent 45µs making 1 call to Koha::Schema::Result::Item::BEGIN@13 # spent 15µs making 1 call to strict::import
14242µs
# spent 31µs (20+11) within Koha::Schema::Result::Item::BEGIN@14 which was called: # once (20µs+11µs) by Class::C3::Componentised::ensure_class_loaded at line 14
use warnings;
# spent 31µs making 1 call to Koha::Schema::Result::Item::BEGIN@14 # spent 11µs making 1 call to warnings::import
15
162168µs
# spent 97µs (26+71) within Koha::Schema::Result::Item::BEGIN@16 which was called: # once (26µs+71µs) by Class::C3::Componentised::ensure_class_loaded at line 16
use base 'DBIx::Class::Core';
# spent 97µs making 1 call to Koha::Schema::Result::Item::BEGIN@16 # spent 71µs making 1 call to base::import
17
18=head1 TABLE: C<items>
19
20=cut
21
221344µs__PACKAGE__->table("items");
# spent 344µ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
27817.34ms__PACKAGE__->add_columns(
# spent 7.34ms 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
3951104µs__PACKAGE__->set_primary_key("itemnumber");
# spent 104µ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
409130µs__PACKAGE__->add_unique_constraint("itembarcodeidx", ["barcode"]);
410
411=head1 RELATIONS
412
413=head2 accountlines
414
415Type: has_many
416
417Related object: L<Koha::Schema::Result::Accountline>
418
419=cut
420
4211334µs__PACKAGE__->has_many(
# spent 334µ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
430Type: belongs_to
431
432Related object: L<Koha::Schema::Result::Biblioitem>
433
434=cut
435
4361796µs__PACKAGE__->belongs_to(
# spent 796µ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
445Type: has_many
446
447Related object: L<Koha::Schema::Result::Branchtransfer>
448
449=cut
450
4511305µs__PACKAGE__->has_many(
# spent 305µ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
460Type: might_have
461
462Related object: L<Koha::Schema::Result::CourseItem>
463
464=cut
465
4661240µs__PACKAGE__->might_have(
# spent 240µ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
475Type: has_many
476
477Related object: L<Koha::Schema::Result::CreatorBatch>
478
479=cut
480
4811228µs__PACKAGE__->has_many(
# spent 228µ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
490Type: might_have
491
492Related object: L<Koha::Schema::Result::HoldFillTarget>
493
494=cut
495
4961171µs__PACKAGE__->might_have(
# spent 171µs 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
505Type: belongs_to
506
507Related object: L<Koha::Schema::Result::Branch>
508
509=cut
510
5111670µs__PACKAGE__->belongs_to(
# spent 670µ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
525Type: belongs_to
526
527Related object: L<Koha::Schema::Result::Branch>
528
529=cut
530
5311648µs__PACKAGE__->belongs_to(
# spent 648µ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
545Type: might_have
546
547Related object: L<Koha::Schema::Result::Issue>
548
549=cut
550
5511274µs__PACKAGE__->might_have(
# spent 274µ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
560Type: might_have
561
562Related object: L<Koha::Schema::Result::ItemsLastBorrower>
563
564=cut
565
5661220µs__PACKAGE__->might_have(
# spent 220µ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
575Type: has_many
576
577Related object: L<Koha::Schema::Result::OldIssue>
578
579=cut
580
5811235µs__PACKAGE__->has_many(
# spent 235µ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
590Type: has_many
591
592Related object: L<Koha::Schema::Result::OldReserve>
593
594=cut
595
5961210µs__PACKAGE__->has_many(
# spent 210µ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
605Type: has_many
606
607Related object: L<Koha::Schema::Result::Reserve>
608
609=cut
610
6111224µs__PACKAGE__->has_many(
# spent 224µ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
620Type: might_have
621
622Related object: L<Koha::Schema::Result::Serialitem>
623
624=cut
625
6261161µs__PACKAGE__->might_have(
# spent 161µ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
637128.7ms__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
# spent 28.7ms making 1 call to DBIx::Class::Relationship::BelongsTo::belongs_to
638
6391182µs__PACKAGE__->belongs_to(
# spent 182µ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
646sub 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
6591;