line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::DBI::Relationship; |
2
|
|
|
|
|
|
|
|
3
|
24
|
|
|
24
|
|
132
|
use strict; |
|
24
|
|
|
|
|
45
|
|
|
24
|
|
|
|
|
823
|
|
4
|
24
|
|
|
24
|
|
135
|
use warnings; |
|
24
|
|
|
|
|
44
|
|
|
24
|
|
|
|
|
2151
|
|
5
|
|
|
|
|
|
|
|
6
|
24
|
|
|
24
|
|
138
|
use base 'Class::Accessor'; |
|
24
|
|
|
|
|
45
|
|
|
24
|
|
|
|
|
13676
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw/name class accessor foreign_class args/); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub set_up { |
11
|
2
|
|
|
2
|
0
|
3
|
my $proto = shift; |
12
|
2
|
|
|
|
|
16
|
my $self = $proto->_init(@_); |
13
|
2
|
|
|
|
|
35
|
$self->_set_up_class_data; |
14
|
2
|
|
|
|
|
62
|
$self->_add_triggers; |
15
|
2
|
|
|
|
|
94
|
$self->_add_methods; |
16
|
2
|
|
|
|
|
6
|
$self; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _init { |
20
|
2
|
|
|
2
|
|
5
|
my $proto = shift; |
21
|
2
|
|
|
|
|
3
|
my $name = shift; |
22
|
2
|
|
|
|
|
25
|
my ($class, $accessor, $foreign_class, $args) = $proto->remap_arguments(@_); |
23
|
2
|
|
|
|
|
29
|
return $proto->new({ |
24
|
|
|
|
|
|
|
name => $name, |
25
|
|
|
|
|
|
|
class => $class, |
26
|
|
|
|
|
|
|
foreign_class => $foreign_class, |
27
|
|
|
|
|
|
|
accessor => $accessor, |
28
|
|
|
|
|
|
|
args => $args, |
29
|
|
|
|
|
|
|
}); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub remap_arguments { |
33
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
34
|
0
|
|
|
|
|
0
|
return @_; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub _set_up_class_data { |
38
|
2
|
|
|
2
|
|
4
|
my $self = shift; |
39
|
2
|
|
|
|
|
6
|
$self->class->_extend_meta($self->name => $self->accessor => $self); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
0
|
0
|
0
|
sub triggers { () } |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub _add_triggers { |
45
|
2
|
|
|
2
|
|
3
|
my $self = shift; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# need to treat as list in case there are multiples for the same point. |
48
|
2
|
50
|
|
|
|
10
|
my @triggers = $self->triggers or return; |
49
|
2
|
|
|
|
|
10
|
while (my ($point, $subref) = (splice @triggers, 0, 2)) { |
50
|
5
|
|
|
|
|
119
|
$self->class->add_trigger($point => $subref); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
1
|
|
|
1
|
0
|
4
|
sub methods { () } |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub _add_methods { |
57
|
2
|
|
|
2
|
|
3
|
my $self = shift; |
58
|
2
|
100
|
|
|
|
11
|
my %methods = $self->methods or return; |
59
|
1
|
|
|
|
|
4
|
my $class = $self->class; |
60
|
24
|
|
|
24
|
|
163
|
no strict 'refs'; |
|
24
|
|
|
|
|
45
|
|
|
24
|
|
|
|
|
2449
|
|
61
|
1
|
|
|
|
|
11
|
foreach my $method (keys %methods) { |
62
|
2
|
|
|
|
|
4
|
*{"$class\::$method"} = $methods{$method}; |
|
2
|
|
|
|
|
13
|
|
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |