1
0
mirror of synced 2025-03-21 23:43:53 +03:00

matching should not change critera

The matching should behave like in ArrayCollection, where it is not changed.
The criteria should be cloned so that it could be used for more than one matching operation.
This commit is contained in:
Oliver Tischlinger 2014-12-04 15:57:10 +01:00 committed by Marco Pivetta
parent 6164f17229
commit b5ba84f667

View File

@ -878,6 +878,7 @@ final class PersistentCollection implements Collection, Selectable
$expression = $criteria->getWhereExpression(); $expression = $criteria->getWhereExpression();
$expression = $expression ? $builder->andX($expression, $ownerExpression) : $ownerExpression; $expression = $expression ? $builder->andX($expression, $ownerExpression) : $ownerExpression;
$criteria = clone $critera;
$criteria->where($expression); $criteria->where($expression);
$persister = $this->em->getUnitOfWork()->getEntityPersister($this->association['targetEntity']); $persister = $this->em->getUnitOfWork()->getEntityPersister($this->association['targetEntity']);