File | /wise/base/static/lib/perl5/site_perl/5.10.0/DBIx/Class/ResultSourceProxy/Table.pm | Statements Executed | 50 | Total Time | 0.002398 seconds |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine | |
---|---|---|---|---|---|---|
5 | 5 | 5 | 0.00041 | 0.00326 | DBIx::Class::ResultSourceProxy::Table:: | table |
0 | 0 | 0 | 0 | 0 | DBIx::Class::ResultSourceProxy::Table:: | BEGIN |
Line | Stmts. | Exclusive Time | Avg. | Code |
---|---|---|---|---|
1 | package DBIx::Class::ResultSourceProxy::Table; | |||
2 | ||||
3 | 3 | 4.2e-5 | 1.4e-5 | use strict; # spent 11µs making 1 call to strict::import |
4 | 3 | 3.6e-5 | 1.2e-5 | use warnings; # spent 29µs making 1 call to warnings::import |
5 | ||||
6 | 3 | 2.9e-5 | 9.7e-6 | use base qw/DBIx::Class::ResultSourceProxy/; # spent 2.18ms making 1 call to base::import |
7 | ||||
8 | 3 | 0.00144 | 0.00048 | use DBIx::Class::ResultSource::Table; # spent 3µs making 1 call to import |
9 | ||||
10 | 1 | 1.4e-5 | 1.4e-5 | __PACKAGE__->mk_classdata(table_class => 'DBIx::Class::ResultSource::Table'); # spent 196µs making 1 call to DBIx::Class::mk_classdata |
11 | ||||
12 | 1 | 7.0e-6 | 7.0e-6 | __PACKAGE__->mk_classdata('table_alias'); # FIXME: Doesn't actually do # spent 138µs making 1 call to DBIx::Class::mk_classdata |
13 | # anything yet! | |||
14 | ||||
15 | =head1 NAME | |||
16 | ||||
17 | DBIx::Class::ResultSourceProxy::Table - provides a classdata table | |||
18 | object and method proxies | |||
19 | ||||
20 | =head1 SYNOPSIS | |||
21 | ||||
22 | __PACKAGE__->table('cd'); | |||
23 | __PACKAGE__->add_columns(qw/cdid artist title year/); | |||
24 | __PACKAGE__->set_primary_key('cdid'); | |||
25 | ||||
26 | =head1 METHODS | |||
27 | ||||
28 | =head2 add_columns | |||
29 | ||||
30 | __PACKAGE__->add_columns(qw/cdid artist title year/); | |||
31 | ||||
32 | Adds columns to the current class and creates accessors for them. | |||
33 | ||||
34 | =cut | |||
35 | ||||
36 | =head2 table | |||
37 | ||||
38 | __PACKAGE__->table('tbl_name'); | |||
39 | ||||
40 | Gets or sets the table name. | |||
41 | ||||
42 | =cut | |||
43 | ||||
44 | # spent 3.26ms (415µs+2.85) within DBIx::Class::ResultSourceProxy::Table::table which was called 5 times, avg 652µs/call:
# once (88µs+619µs) at line 10 of /wise/base/deliv/dev/lib/perl/WISE/DB/FrameIndex/Scan.pm
# once (87µs+589µs) at line 11 of /wise/base/deliv/dev/lib/perl/WISE/DB/FrameIndex/HouseKeeping.pm
# once (80µs+584µs) at line 10 of /wise/base/deliv/dev/lib/perl/WISE/DB/FrameIndex/Frame.pm
# once (78µs+532µs) at line 10 of /wise/base/deliv/dev/lib/perl/WISE/DB/FrameIndex/MissionPlan.pm
# once (82µs+522µs) at line 11 of /wise/base/deliv/dev/lib/perl/WISE/DB/FrameIndex/Tile.pm | |||
45 | 35 | 0.00083 | 2.4e-5 | my ($class, $table) = @_; |
46 | return $class->result_source_instance->name unless $table; | |||
47 | unless (ref $table) { # spent 769µs making 5 calls to Class::Accessor::Grouped::__ANON__[(eval 0)[/wise/base/static/lib/perl5/site_perl/5.10.0/Class/Accessor/Grouped.pm:156]:8], avg 154µs/call
# spent 162µs making 5 calls to DBIx::Class::ResultSource::new, avg 32µs/call
# spent 127µs making 5 calls to UNIVERSAL::can, avg 25µs/call | |||
48 | $table = $class->table_class->new({ | |||
49 | $class->can('result_source_instance') ? | |||
50 | %{$class->result_source_instance} : (), | |||
51 | name => $table, | |||
52 | result_class => $class, | |||
53 | source_name => undef, | |||
54 | }); | |||
55 | } | |||
56 | ||||
57 | $class->mk_classdata('result_source_instance') # spent 1.19ms making 5 calls to DBIx::Class::mk_classdata, avg 239µs/call
# spent 34µs making 5 calls to UNIVERSAL::can, avg 7µs/call | |||
58 | unless $class->can('result_source_instance'); | |||
59 | ||||
60 | $class->result_source_instance($table); # spent 234µs making 5 calls to Class::Accessor::Grouped::__ANON__[(eval 0)[/wise/base/static/lib/perl5/site_perl/5.10.0/Class/Accessor/Grouped.pm:156]:8], avg 47µs/call | |||
61 | ||||
62 | if ($class->can('schema_instance')) { # spent 123µs making 5 calls to UNIVERSAL::can, avg 25µs/call | |||
63 | $class =~ m/([^:]+)$/; | |||
64 | $class->schema_instance->register_class($class, $class); | |||
65 | } | |||
66 | return $class->result_source_instance->name; # spent 203µs making 10 calls to Class::Accessor::Grouped::__ANON__[(eval 0)[/wise/base/static/lib/perl5/site_perl/5.10.0/Class/Accessor/Grouped.pm:156]:8], avg 20µs/call | |||
67 | } | |||
68 | ||||
69 | =head2 has_column | |||
70 | ||||
71 | if ($obj->has_column($col)) { ... } | |||
72 | ||||
73 | Returns 1 if the class has a column of this name, 0 otherwise. | |||
74 | ||||
75 | =cut | |||
76 | ||||
77 | =head2 column_info | |||
78 | ||||
79 | my $info = $obj->column_info($col); | |||
80 | ||||
81 | Returns the column metadata hashref for a column. For a description of | |||
82 | the various types of column data in this hashref, see | |||
83 | L<DBIx::Class::ResultSource/add_column> | |||
84 | ||||
85 | =cut | |||
86 | ||||
87 | =head2 columns | |||
88 | ||||
89 | my @column_names = $obj->columns; | |||
90 | ||||
91 | =cut | |||
92 | ||||
93 | 1 | 4.0e-6 | 4.0e-6 | 1; |
94 | ||||
95 | =head1 AUTHORS | |||
96 | ||||
97 | Matt S. Trout <mst@shadowcatsystems.co.uk> | |||
98 | ||||
99 | =head1 LICENSE | |||
100 | ||||
101 | You may distribute this code under the same terms as Perl itself. | |||
102 | ||||
103 | =cut | |||
104 |