From 788312e1fca77065c52c5d896e58f9e05866ebda Mon Sep 17 00:00:00 2001 From: guilhermeblanco Date: Sun, 6 Sep 2009 02:45:46 +0000 Subject: [PATCH] [2.0] fixes #2478 Add/persist/retrieve was doubling the resultset of collection is solved. It was a merge in PersistentCollection creation. I am not 100% sure it is the right patch, but it works and does not break any other unit tests --- .../ORM/Internal/Hydration/ObjectHydrator.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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);