title: Deleting record in many-to-many table
body: <p>I'm following the security chapter of the Symfony 2 book.</p>
  
  <p>There's is an example with a table <code>USERS</code> and <code>GROUPS</code>. There is a <strong>many-to-many</strong> relationship between <code>USERS</code> and <code>GROUPS</code>, which creates in the database a table called <code>USERGROUPS</code>.</p>
  
  <p>What I want is to delete a record from <code>USERGROUPS</code>, for example:</p>
  
  <pre><code>DELETE from USERGROUPS WHERE user_id = 1 and group_id = 1 
  </code></pre>
  
  <p>I don't know how to do this since I don't have an <code>USERGROUPS.php</code> table file. </p>
  
  <p>Using DQL, for example, I want to be able to do this:</p>
  
  <pre><code>$em = $this-&gt;getDoctrine()-&gt;getEntityManager();
  $query = $em-&gt;createQuery(
      'DELETE FROM AcmeStoreBundle:UserGroups ug WHERE ug.user_id = :user 
      and ug.group_id = :group'
  )-&gt;setParameter(array('user' =&gt; $userid, 'group' =&gt; $groupid));
  </code></pre>
  
  <p>I hope you get the idea.</p>
  
  <p>Then, how do I remove from this table?</p>