started working with doctrine in ZF2 and need to delete an entity from persistence.
$result = $em->getRepository('zmpim\Entity\Collection')->findOneBy(array('id'=>$id));
$products = $result->getProducts();
$this->assertSame(1, count($products));
$this->assertSame(3, count($products[0]->getFields()));
$em->remove($result);
$em->persist($result);
$em->flush($result);
The example is in a unit test. I would expect, that the entity is deleted after it. But the entity and some OneToMany entities are still there.
cu n00n