joomla/joomla-platform — pull request #813 by chdemko (2012-01-30 22:42:44+00:00)
Title: Implement a Database Iterator for iterating on queries

This pull request implement a Database Iterator for all SQL engines. The use is:

$query = JFactory::getDbo()->getQuery(true)->select('*')->from('#__content);
$iterator = new JDatabaseIterator($query);
foreach ($iterator as $i => $row)
{
// Some code to deal with $i and $row
}

or

$array = iterator_to_array($iterator); // To get all the rows in an array