line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBICx::AutoDoc::Magic; |
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
36
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.08'; |
5
|
1
|
|
|
1
|
|
237
|
use DBIx::Class::Relationship::Helpers; |
|
1
|
|
|
|
|
36124
|
|
|
1
|
|
|
|
|
31
|
|
6
|
1
|
|
|
1
|
|
7
|
use base qw( DBIx::Class ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
212
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
__PACKAGE__->mk_group_accessors( inherited => qw( _autodoc ) ); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $func_body = <<'END'; |
11
|
|
|
|
|
|
|
my $self = shift; |
12
|
|
|
|
|
|
|
$self->_autodoc_record_relationship( @_ ); |
13
|
|
|
|
|
|
|
$self->maybe::next::method( @_ ); |
14
|
|
|
|
|
|
|
END |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
0
|
1
|
|
eval "sub $_ { $func_body }" for qw( |
|
0
|
|
|
0
|
1
|
|
|
|
0
|
|
|
0
|
1
|
|
|
|
0
|
|
|
0
|
1
|
|
|
|
0
|
|
|
0
|
1
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has_many has_one might_have belongs_to many_to_many |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# This needs to go after the stuff above, so Class::C3 can figure out the |
21
|
|
|
|
|
|
|
# methods in this class |
22
|
|
|
|
|
|
|
DBIx::Class::Relationship::Helpers->load_components( '+DBICx::AutoDoc::Magic' ); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _autodoc_record_relationship { |
25
|
0
|
|
|
0
|
|
|
my $self = shift; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my ( $method ) = ( caller( 1 ) )[3]; |
28
|
0
|
|
|
|
|
|
$method =~ s/^.*:://; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
0
|
|
|
|
my $class = ref( $self ) || $self; |
31
|
0
|
0
|
|
|
|
|
if ( ! $class->_autodoc ) { $class->_autodoc( {} ) } |
|
0
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
push( @{ $class->_autodoc->{ 'relationships' } }, [ $method, @_ ] ); |
|
0
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |