1
0
mirror of synced 2024-12-04 18:56:06 +03:00

Remove useless dependency

This commit is contained in:
Michaël Gallego 2013-12-19 20:13:44 +01:00 committed by Marco Pivetta
parent f1a793f2ee
commit b556bcb16c
2 changed files with 2 additions and 12 deletions

View File

@ -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);
}
}

View File

@ -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;