line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSAN::Index::Author; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
145
|
use 5.006; |
|
6
|
|
|
|
|
21
|
|
|
6
|
|
|
|
|
263
|
|
4
|
6
|
|
|
6
|
|
33
|
use strict; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
205
|
|
5
|
6
|
|
|
6
|
|
35
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
264
|
|
6
|
6
|
|
|
6
|
|
4003
|
use JSAN::Index::Release (); |
|
6
|
|
|
|
|
18
|
|
|
6
|
|
|
|
|
4068
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.29'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub releases { |
11
|
1
|
|
|
1
|
1
|
4
|
JSAN::Index::Release->select( 'where author = ?', $_[0]->login ); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub retrieve { |
15
|
2
|
|
|
2
|
0
|
259222
|
my $class = shift; |
16
|
2
|
|
|
|
|
15
|
my %params = @_; |
17
|
2
|
|
|
|
|
75
|
my $sql = join " and ", map { "$_ = ?" } keys(%params); |
|
2
|
|
|
|
|
14
|
|
18
|
2
|
|
|
|
|
19
|
my @result = $class->select( "where $sql", values(%params) ); |
19
|
2
|
50
|
|
|
|
10
|
if ( @result == 1 ) { |
20
|
2
|
|
|
|
|
18
|
return $result[0]; |
21
|
|
|
|
|
|
|
} |
22
|
0
|
0
|
|
|
|
0
|
if ( @result > 1 ) { |
23
|
0
|
|
|
|
|
0
|
Carp::croak("Found more than one author record"); |
24
|
|
|
|
|
|
|
} else { |
25
|
0
|
|
|
|
|
0
|
return undef; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub search_like { |
31
|
0
|
|
|
0
|
0
|
0
|
my $class = shift; |
32
|
0
|
|
|
|
|
0
|
my %params = @_; |
33
|
0
|
|
|
|
|
0
|
my $sql = join " and ", map { "$_ like ?" } keys(%params); |
|
0
|
|
|
|
|
0
|
|
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
0
|
my @result = $class->select( "where $sql", values(%params) ); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
return @result |
38
|
0
|
|
|
|
|
0
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
###################################################################### |
43
|
|
|
|
|
|
|
# Generated by ORLite 1.25 (Unused parts are commented out) |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
#sub base { 'JSAN::Index' } |
46
|
|
|
|
|
|
|
# |
47
|
|
|
|
|
|
|
#sub table { 'author' } |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub select { |
50
|
2
|
|
|
2
|
1
|
5
|
my $class = shift; |
51
|
2
|
|
|
|
|
7
|
my $sql = 'select "login", "name", "doc", "email", "url" from author '; |
52
|
2
|
50
|
|
|
|
13
|
$sql .= shift if @_; |
53
|
2
|
|
|
|
|
21
|
my $rows = JSAN::Index->selectall_arrayref( $sql, { Slice => {} }, @_ ); |
54
|
2
|
|
|
|
|
18363
|
bless( $_, 'JSAN::Index::Author' ) foreach @$rows; |
55
|
2
|
50
|
|
|
|
17
|
wantarray ? @$rows : $rows; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub count { |
59
|
0
|
|
|
0
|
1
|
0
|
my $class = shift; |
60
|
0
|
|
|
|
|
0
|
my $sql = 'select count(*) from author '; |
61
|
0
|
0
|
|
|
|
0
|
$sql .= shift if @_; |
62
|
0
|
|
|
|
|
0
|
JSAN::Index->selectrow_array( $sql, {}, @_ ); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub iterate { |
66
|
0
|
|
|
0
|
0
|
0
|
my $class = shift; |
67
|
0
|
|
|
|
|
0
|
my $call = pop; |
68
|
0
|
|
|
|
|
0
|
my $sql = 'select "login", "name", "doc", "email", "url" from author '; |
69
|
0
|
0
|
|
|
|
0
|
$sql .= shift if @_; |
70
|
0
|
|
|
|
|
0
|
my $sth = JSAN::Index->prepare( $sql ); |
71
|
0
|
|
|
|
|
0
|
$sth->execute( @_ ); |
72
|
0
|
|
|
|
|
0
|
while ( $_ = $sth->fetchrow_hashref ) { |
73
|
0
|
|
|
|
|
0
|
bless( $_, 'JSAN::Index::Author' ); |
74
|
0
|
0
|
|
|
|
0
|
$call->() or last; |
75
|
|
|
|
|
|
|
} |
76
|
0
|
|
|
|
|
0
|
$sth->finish; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub login { |
80
|
2
|
|
|
2
|
1
|
870
|
$_[0]->{login}; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub name { |
84
|
1
|
|
|
1
|
1
|
7
|
$_[0]->{name}; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub doc { |
88
|
1
|
|
|
1
|
1
|
11
|
$_[0]->{doc}; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub email { |
92
|
1
|
|
|
1
|
1
|
12
|
$_[0]->{email}; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub url { |
96
|
1
|
|
|
1
|
1
|
8
|
$_[0]->{url}; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
1; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
__END__; |