2009-01-14 00:56:43 +03:00
|
|
|
<?php
|
2009-01-22 22:38:10 +03:00
|
|
|
|
|
|
|
namespace Doctrine\ORM\Internal\Hydration;
|
|
|
|
|
2009-01-14 00:56:43 +03:00
|
|
|
/**
|
|
|
|
* Represents a result structure that can be iterated over, hydrating row-by-row
|
|
|
|
* during the iteration. An IterableResult is obtained by AbstractHydrator#iterate().
|
|
|
|
*
|
|
|
|
* @author robo
|
|
|
|
* @since 2.0
|
|
|
|
*/
|
2009-01-22 22:38:10 +03:00
|
|
|
class IterableResult
|
2009-01-14 00:56:43 +03:00
|
|
|
{
|
|
|
|
private $_hydrator;
|
|
|
|
|
|
|
|
public function __construct($hydrator)
|
|
|
|
{
|
|
|
|
$this->_hydrator = $hydrator;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the next set of results.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function next()
|
|
|
|
{
|
|
|
|
return $this->_hydrator->hydrateRow();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|