Skip to content

Commit

Permalink
Allow change the hydratation mode on ResultSet
Browse files Browse the repository at this point in the history
  • Loading branch information
fprochazka committed Oct 20, 2013
1 parent 2c06421 commit dfc5b0e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Kdyby/Doctrine/ResultSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,15 @@ public function getTotalCount()


/**
* @throws \Kdyby\Doctrine\QueryException
* @param int $hydrationMode
* @throws QueryException
* @return \ArrayIterator
*/
public function getIterator()
public function getIterator($hydrationMode = ORM\AbstractQuery::HYDRATE_OBJECT)
{
try {
$this->query->setHydrationMode($hydrationMode);

if ($this->query->getMaxResults() > 0 || $this->query->getFirstResult() > 0) {
return $this->getPaginatedQuery()->getIterator();
}
Expand Down

0 comments on commit dfc5b0e

Please sign in to comment.