line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::DBI::Plugin::Param; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
871236
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
52
|
|
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
50
|
|
5
|
2
|
|
|
2
|
|
11
|
use Carp; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
238
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub import { |
10
|
2
|
|
|
2
|
|
14
|
my $class = shift; |
11
|
2
|
|
|
|
|
4
|
my $callpkg = caller; |
12
|
2
|
50
|
|
|
|
27
|
die "This module only works correctly under a subclass of Class::DBI" |
13
|
|
|
|
|
|
|
unless ($callpkg->isa('Class::DBI')); |
14
|
|
|
|
|
|
|
{ |
15
|
2
|
|
|
2
|
|
10
|
no strict 'refs'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
189
|
|
|
2
|
|
|
|
|
3
|
|
16
|
2
|
|
|
|
|
50
|
*{$callpkg."::param"} = sub { |
17
|
0
|
|
|
0
|
|
|
my $self = shift; |
18
|
0
|
0
|
|
|
|
|
my $column_name = shift or |
19
|
|
|
|
|
|
|
croak "You gave me no parameters to param()!"; |
20
|
0
|
|
|
|
|
|
return $self->$column_name(@_); |
21
|
|
|
|
|
|
|
} |
22
|
2
|
|
|
|
|
8
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |