line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#---------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
package DBIx::DataModel::Schema::ResultAs::Flat_arrayref; |
3
|
|
|
|
|
|
|
#---------------------------------------------------------------------- |
4
|
3
|
|
|
3
|
|
2834
|
use warnings; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
140
|
|
5
|
3
|
|
|
3
|
|
22
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
98
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
18
|
use parent 'DBIx::DataModel::Schema::ResultAs'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
21
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
228
|
use namespace::clean; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
22
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub get_result { |
12
|
6
|
|
|
6
|
1
|
18
|
my ($self, $statement) = @_; |
13
|
|
|
|
|
|
|
|
14
|
6
|
|
|
|
|
45
|
$statement->execute; |
15
|
6
|
|
|
|
|
74
|
$statement->make_fast; |
16
|
6
|
|
|
|
|
13
|
my @vals; |
17
|
6
|
|
|
|
|
20
|
my @headers = $statement->headers; |
18
|
6
|
|
|
|
|
153
|
while (my $row = $statement->next) { |
19
|
13
|
|
|
|
|
29
|
push @vals, @{$row}{@headers}; |
|
13
|
|
|
|
|
50
|
|
20
|
|
|
|
|
|
|
} |
21
|
6
|
|
|
|
|
25
|
$statement->finish; |
22
|
|
|
|
|
|
|
|
23
|
6
|
|
|
|
|
250
|
return \@vals; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# THINK : should we take a list of columns as arguments, |
27
|
|
|
|
|
|
|
# i.e. -result_as => [flat_arrayref => ($col1, ...)], instead of taking |
28
|
|
|
|
|
|
|
# ->headers ? Easy to implement, but it wouldn't really make sense, |
29
|
|
|
|
|
|
|
# because the choice of columns is done in the -columns arg to |
30
|
|
|
|
|
|
|
# select(). |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |