Commit 788312e1 authored by guilhermeblanco's avatar guilhermeblanco

[2.0] fixes #2478 Add/persist/retrieve was doubling the resultset of...

[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
parent 2ff65dd7
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment