diff --git a/lib/Doctrine/ORM/EntityRepository.php b/lib/Doctrine/ORM/EntityRepository.php index a2d7fd8db..47d0648be 100644 --- a/lib/Doctrine/ORM/EntityRepository.php +++ b/lib/Doctrine/ORM/EntityRepository.php @@ -301,6 +301,6 @@ class EntityRepository implements ObjectRepository, Selectable { $persister = $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName); - return new LazyCriteriaCollection($this->_em, $persister, $criteria); + return new LazyCriteriaCollection($persister, $criteria); } } diff --git a/lib/Doctrine/ORM/LazyCriteriaCollection.php b/lib/Doctrine/ORM/LazyCriteriaCollection.php index a545c0ad7..6383d18d0 100644 --- a/lib/Doctrine/ORM/LazyCriteriaCollection.php +++ b/lib/Doctrine/ORM/LazyCriteriaCollection.php @@ -33,11 +33,6 @@ use Doctrine\ORM\Persisters\BasicEntityPersister; */ class LazyCriteriaCollection implements Collection { - /** - * @var EntityManager - */ - protected $entityManager; - /** * @var BasicEntityPersister */ @@ -66,13 +61,11 @@ class LazyCriteriaCollection implements Collection protected $count; /** - * @param EntityManager $entityManager * @param BasicEntityPersister $entityPersister * @param Criteria $criteria */ - public function __construct(EntityManager $entityManager, BasicEntityPersister $entityPersister, Criteria $criteria) + public function __construct(BasicEntityPersister $entityPersister, Criteria $criteria) { - $this->entityManager = $entityManager; $this->entityPersister = $entityPersister; $this->criteria = $criteria; } @@ -88,9 +81,6 @@ class LazyCriteriaCollection implements Collection return $this->count; } - //$exp = $this->criteria->expr()->eq('username', 'bar'); - //$this->criteria = new Criteria($exp); - $this->count = $this->entityPersister->count($this->criteria); return $this->count;