line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::Class::Cursor; |
2
|
|
|
|
|
|
|
|
3
|
147
|
|
|
147
|
|
27599
|
use strict; |
|
147
|
|
|
|
|
233
|
|
|
147
|
|
|
|
|
4021
|
|
4
|
147
|
|
|
147
|
|
588
|
use warnings; |
|
147
|
|
|
|
|
186
|
|
|
147
|
|
|
|
|
3950
|
|
5
|
|
|
|
|
|
|
|
6
|
147
|
|
|
147
|
|
572
|
use base qw/DBIx::Class/; |
|
147
|
|
|
|
|
228
|
|
|
147
|
|
|
|
|
30638
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
DBIx::Class::Cursor - Abstract object representing a query cursor on a |
11
|
|
|
|
|
|
|
resultset. |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $cursor = $schema->resultset('CD')->cursor(); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# raw values off the database handle in resultset columns/select order |
18
|
|
|
|
|
|
|
my @next_cd_column_values = $cursor->next; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# list of all raw values as arrayrefs |
21
|
|
|
|
|
|
|
my @all_cds_column_values = $cursor->all; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 DESCRIPTION |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
A Cursor represents a query cursor on a L object. It |
26
|
|
|
|
|
|
|
allows for traversing the result set with L, retrieving all results with |
27
|
|
|
|
|
|
|
L and resetting the cursor with L. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Usually, you would use the cursor methods built into L |
30
|
|
|
|
|
|
|
to traverse it. See L, |
31
|
|
|
|
|
|
|
L and L for more |
32
|
|
|
|
|
|
|
information. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 METHODS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 new |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Virtual method. Returns a new L object. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub new { |
43
|
0
|
|
|
0
|
1
|
0
|
die "Virtual method!"; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 next |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Virtual method. Advances the cursor to the next row. Returns an array of |
49
|
|
|
|
|
|
|
column values (the result of L method). |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub next { |
54
|
0
|
|
|
0
|
1
|
0
|
die "Virtual method!"; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 reset |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Virtual method. Resets the cursor to the beginning. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=cut |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub reset { |
64
|
0
|
|
|
0
|
1
|
0
|
die "Virtual method!"; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 all |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Virtual method. Returns all rows in the L. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub all { |
74
|
1
|
|
|
1
|
1
|
21
|
my ($self) = @_; |
75
|
1
|
|
|
|
|
4
|
$self->reset; |
76
|
1
|
|
|
|
|
2
|
my @all; |
77
|
1
|
|
|
|
|
3
|
while (my @row = $self->next) { |
78
|
2
|
|
|
|
|
7
|
push(@all, \@row); |
79
|
|
|
|
|
|
|
} |
80
|
1
|
|
|
|
|
4
|
$self->reset; |
81
|
1
|
|
|
|
|
4
|
return @all; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 FURTHER QUESTIONS? |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Check the list of L. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This module is free software L |
91
|
|
|
|
|
|
|
by the L. You can |
92
|
|
|
|
|
|
|
redistribute it and/or modify it under the same terms as the |
93
|
|
|
|
|
|
|
L. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=cut |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
1; |