From b556bcb16c3a18985dc18b1703898f76a58fcbf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Gallego?= Date: Thu, 19 Dec 2013 20:13:44 +0100 Subject: [PATCH] Remove useless dependency --- lib/Doctrine/ORM/EntityRepository.php | 2 +- lib/Doctrine/ORM/LazyCriteriaCollection.php | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) 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;