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