Rose::DB::Object::Iterator3pm
Iterate over a series of rose::db::objects.
Usage
$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;}
Overview
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.
Object methods
error-
Returns the text message associated with the last error, or false if there was no error.
finish-
Prematurely stop the iteration (i.e., before iterating over all of the available objects).
next-
Return the next Rose::DB::Object-derived object. Returns false (but defined) if there are no more objects to iterate over, or undef if there was an error.
total-
Returns the total number of objects iterated over so far.
Releases
9 releases since Debian 5.0 (Lenny); the text changed 7 times.