title: Detached entity error in Doctrine
body: <p>I am posting an array of entities to a controller, all of which I'd like to delete. However, the below code throws an <code>A detached entity was found during removed MyProject\Bundle\MyBundle\Entity\MyEntity@000000004249c13f00000001720a4b59</code> error. Where am I going wrong?</p>
  
  <pre><code>$doctrineManager = $this-&gt;getDoctrine()-&gt;getManager();
  foreach ($form-&gt;getData()-&gt;getEntities() as $entity) {
      $doctrineManager-&gt;merge($entity);  
      $doctrineManager-&gt;remove($entity);
  }
  $doctrineManager-&gt;flush();
  </code></pre>