title: Deleting object part of a Many-to-Many relationship with EntityManager returns error
body: <p>I have a schema with a Many-to-Many relationship between entities "User" and "Role" mapped as follows.</p>
  
  <p>Role entity</p>
  
  <pre><code>/**
   * @ORM\ManyToMany(targetEntity="User", mappedBy="roles", cascade={"persist", "remove"})
   */
  protected $users;
  </code></pre>
  
  <p>and the User entity</p>
  
  <pre><code>/**
   * @ORM\ManyToMany(targetEntity="Role", inversedBy="users", cascade={"persist", "remove"})
   * @ORM\JoinTable(name="users_roles")
   * 
   * @var ArrayCollection $userRoles
   */
  protected $userRoles;
  </code></pre>
  
  <p>When I try to delete a role object with the following code,</p>
  
  <pre><code>$role = $em-&gt;getRepository('ACMEDefaultBundle:Role')-&gt;find($id);
  $em-&gt;remove($role);
  $em-&gt;flush();
  </code></pre>
  
  <p>I am getting a Doctrine Exception</p>
  
  <blockquote>
    <p>ErrorException: Notice: Undefined index: roles in /media/sf_sandbox/aalcodev/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 964 (uncaught exception) at /media/sf_sandbox/aalcodev/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 964</p>
  </blockquote>
  
  <p>Please help. Thank you.</p>