diff --git a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php index 4b4801960..f1a90d4de 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php @@ -138,8 +138,15 @@ class ObjectHydrator extends AbstractHydrator $class = $this->_ce[get_class($entity)]; $relation = $class->associationMappings[$name]; - $pColl = new PersistentCollection($this->_em, $this->_ce[$relation->targetEntityName], - $class->reflFields[$name]->getValue($entity) ?: new ArrayCollection); + $pColl = new PersistentCollection( + $this->_em, + $this->_ce[$relation->targetEntityName], + /* + TICKET #2478: This seems to double resultset in Collections after add/persist/retrieve execution + $class->reflFields[$name]->getValue($entity) ?: new ArrayCollection + */ + new ArrayCollection() + ); $pColl->setOwner($entity, $relation); $class->reflFields[$name]->setValue($entity, $pColl);