Permalink
Browse files

Merge pull request #769 from lemoinem/fix/DRY-converting-cursor-to-array

[DocumentRepository] Use Cursor::toArray() instead of iterator_to_array()
  • Loading branch information...
2 parents be4a8a8 + a60114d commit f4a5623da2cf6e1bffecca4296cce50a68a35e49 @jmikola jmikola committed Jan 17, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Doctrine/ODM/MongoDB/DocumentRepository.php
View
2 lib/Doctrine/ODM/MongoDB/DocumentRepository.php
@@ -170,7 +170,7 @@ public function findAll()
*/
public function findBy(array $criteria, array $sort = null, $limit = null, $skip = null)
{
- return iterator_to_array($this->getDocumentPersister()->loadAll($criteria, $sort, $limit, $skip), false);
+ return $this->getDocumentPersister()->loadAll($criteria, $sort, $limit, $skip)->toArray(false);
}
/**

0 comments on commit f4a5623

Please sign in to comment.