use namespace::clean;
__PACKAGE__->mk_group_accessors('simple' =>
- qw/sth storage args pos attrs _dbh_gen/
+ qw/sth storage args attrs/
);
=head1 NAME
my $new = {
storage => $storage,
args => $args,
- pos => 0,
attrs => $attrs,
_dbh_gen => $storage->{_dbh_gen},
+ _pos => 0,
+ _done => 0,
};
return bless ($new, $class);
if (
$self->{attrs}{software_limit}
&& $self->{attrs}{rows}
- && $self->{pos} >= $self->{attrs}{rows}
+ && $self->{_pos} >= $self->{attrs}{rows}
) {
$self->sth->finish if $self->sth->{Active};
$self->sth(undef);
- $self->{done} = 1;
+ $self->{_done} = 1;
}
- return if $self->{done};
+
+ return if $self->{_done};
+
unless ($self->sth) {
$self->sth(($storage->_select(@{$self->{args}}))[1]);
if ($self->{attrs}{software_limit}) {
}
my @row = $self->sth->fetchrow_array;
if (@row) {
- $self->{pos}++;
+ $self->{_pos}++;
} else {
$self->sth(undef);
- $self->{done} = 1;
+ $self->{_done} = 1;
}
return @row;
}
my ($self) = @_;
$self->sth(undef);
- delete $self->{done};
- $self->{pos} = 0;
+ $self->{_done} = 0;
+ $self->{_pos} = 0;
}
sub _check_dbh_gen {