1 package DBIx::Class::Cursor;
10 my ($it_class, $db_class, $sth, $args, $cols, $attrs) = @_;
11 $sth->execute(@{$args || []}) unless $sth->{Active};
18 return bless ($new, $it_class);
23 my @row = $self->{sth}->fetchrow_array;
25 #unless (@row) { $self->{sth}->finish; return; }
26 return $self->{class}->_row_to_object($self->{cols}, \@row);
31 if (my $cond = $self->{attrs}->{where}) {
32 my $class = $self->{class};
33 my $sth = $class->_get_sth( 'select', [ 'COUNT(*)' ],
34 $class->_table_name, $cond);
35 $sth->execute(@{$self->{args} || []});
36 my ($count) = $sth->fetchrow_array;
40 return scalar $_[0]->all; # So inefficient
48 while (my $obj = $self->next) {
56 $_[0]->{sth}->finish if $_[0]->{sth}->{Active};
57 $_[0]->{sth}->execute(@{$_[0]->{args} || []});
62 return $_[0]->reset->next;