1
0
mirror of synced 2025-01-30 20:11:49 +03:00

[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

This commit is contained in:
guilhermeblanco 2009-09-06 02:45:46 +00:00
parent 2ff65dd7f0
commit 788312e1fc

View File

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