line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::DataModel::Meta::Type; |
2
|
5
|
|
|
5
|
|
4952
|
use strict; |
|
5
|
|
|
|
|
38
|
|
|
5
|
|
|
|
|
190
|
|
3
|
5
|
|
|
5
|
|
30
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
186
|
|
4
|
5
|
|
|
5
|
|
31
|
use parent "DBIx::DataModel::Meta"; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
33
|
|
5
|
5
|
|
|
5
|
|
337
|
use DBIx::DataModel; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
27
|
|
6
|
5
|
|
|
5
|
|
44
|
use DBIx::DataModel::Meta::Utils qw/define_readonly_accessors does/; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
368
|
|
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
47
|
use Scalar::Util qw/weaken/; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
297
|
|
9
|
5
|
|
|
5
|
|
44
|
use Params::Validate qw/validate_with OBJECT SCALAR HASHREF/; |
|
5
|
|
|
|
|
17
|
|
|
5
|
|
|
|
|
348
|
|
10
|
5
|
|
|
5
|
|
38
|
use Carp::Clan qw[^(DBIx::DataModel::|SQL::Abstract)]; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
58
|
|
11
|
5
|
|
|
5
|
|
488
|
use namespace::clean; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
49
|
|
12
|
|
|
|
|
|
|
|
13
|
5
|
|
|
5
|
|
1760
|
{no strict 'refs'; *CARP_NOT = \@DBIx::DataModel::CARP_NOT;} |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
1297
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
6
|
|
|
6
|
0
|
13
|
my $class = shift; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# parse arguments and create $self |
19
|
6
|
|
|
|
|
147
|
my $self = validate_with( |
20
|
|
|
|
|
|
|
params => \@_, |
21
|
|
|
|
|
|
|
spec => { |
22
|
|
|
|
|
|
|
schema => {type => OBJECT, isa => "DBIx::DataModel::Meta::Schema"}, |
23
|
|
|
|
|
|
|
name => {type => SCALAR}, |
24
|
|
|
|
|
|
|
handlers => {type => HASHREF}, |
25
|
|
|
|
|
|
|
}, |
26
|
|
|
|
|
|
|
allow_extra => 0, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
6
|
|
|
|
|
34
|
while (my ($name, $body) = each %{$self->{handlers}}) { |
|
19
|
|
|
|
|
212
|
|
30
|
13
|
50
|
|
|
|
35
|
does($body, 'CODE') |
31
|
|
|
|
|
|
|
or croak "handler body for $name is not a code reference"; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# avoid circular references |
35
|
6
|
|
|
|
|
45
|
weaken $self->{schema}; |
36
|
|
|
|
|
|
|
|
37
|
6
|
|
|
|
|
19
|
bless $self, $class; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# accessor methods |
42
|
|
|
|
|
|
|
define_readonly_accessors(__PACKAGE__, qw/schema name handlers/); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |