John Drago > Class-DBI-Lite-0.004 > Class::DBI::Lite::Iterator

Download:
Class-DBI-Lite-0.004.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source   Latest Release: Class-DBI-Lite-0.034

NAME ^

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

EXPERIMENTAL STATUS ^

**NOTE**: This module is still under development. It is likely to change in dramatic ways without any warning.

SYNOPSIS ^

  # Get an iterator somehow:
  my $iter = My::User->retrieve_all;
  
  my $user = $iter->first;
  
  my $record_count = $iter->count;
  
  while( my $user = $iter->next )
  {
    ...
  }# end while()
  
  # We can reset the iterator to go back to the beginning:
  $iter->reset;
  print $_->id . "\n" while $_ = $iter->next;

DESCRIPTION ^

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

PUBLIC PROPERTIES ^

count

Returns the number of records in the Iterator.

PUBLIC METHODS ^

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 ^

Class::DBI:Lite

AUTHOR ^

John Drago <jdrago_999@yahoo.com>.

LICENSE AND COPYRIGHT ^

Copyright 2008 John Drago <jdrago_999@yahoo.com>. All rights reserved.

This software is Free software and may be used and distributed under the same terms as perl itself.