Class::DBI::Lite::Iterator - Simple iterator for Class::DBI::Lite


Class-DBI-Lite documentation  | view source Contained in the Class-DBI-Lite distribution.

Index


NAME

Top

Class::DBI::Lite::Iterator - Simple iterator for Class::DBI::Lite

SYNOPSIS

Top

  # Get an iterator somehow:
  my $iter = app::artist->retrieve_all;

  my $artist = $iter->first;

  my $record_count = $iter->count;

  while( my $artist = $iter->next )
  {
    ...
  }# end while()

  # We can reset the iterator to go back to the beginning:
  $iter->reset;
  print $_->id . "\n" while $_ = $iter->next;

DESCRIPTION

Top

Provides a simple iterator-based approach to Class::DBI::Lite resultsets.

PUBLIC PROPERTIES

Top

count

Returns the number of records in the Iterator.

PUBLIC METHODS

Top

next

Returns the next object in the series, or undef.

Moves the internal cursor to the next object if one exists.

reset

Resets the internal cursor to the first object if one exists.

SEE ALSO

Top

Class::DBI:Lite

AUTHOR

Top

John Drago <jdrago_999@yahoo.com>.

LICENSE AND COPYRIGHT

Top


Class-DBI-Lite documentation  | view source Contained in the Class-DBI-Lite distribution.