Rose::DB::Object::Iterator
Iterate over a series of Rose::DB::Objects.
- Provided by: librose-db-object-perl (Version: 1:0.820-2)
- Report a bug
Iterate over a series of Rose::DB::Objects.
$iterator = Rose::DB::Object::Manager->get_objects_iterator(...);
while($object = $iterator->next)
{
# do stuff with $object...
if(...) # bail out early
{
$iterator->finish;
last;
}
}
if($iterator->error)
{
print "There was an error: ", $iterator->error;
}
else
{
print "Total: ", $iterator->total;
}
Rose::DB::Object::Iterator is an iterator object that traverses a database query, returning Rose::DB::Object-derived objects for each row. Rose::DB::Object::Iterator objects are created by calls to the get_objects_iterator method of Rose::DB::Object::Manager or one of its subclasses.
John C. Siracusa (siracusa@gmail.com)
Copyright (c) 2010 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.