title: How to remove a collection element without EntityManager#remove(...) in Doctrine 2?
body: <p>I have a classical construction like <code>EntityA OneToMany EntityB</code>. Implemented as a bidirectional relationship:</p>
  
  <ul>
  <li>the <code>EntityB</code> has a property <code>$entityA</code> of type <code>EntityA</code> and</li>
  <li>the <code>EntityA</code> has a property <code>$entityBs</code>, that contains an <code>ArrayCollection</code> of <code>EntityB</code> elements.</li>
  </ul>
  
  <p>Now I want to remove some <code>EntityB</code> elements. It would work like this:</p>
  
  <pre><code>$entityManager-&gt;remove($myEntityB);
  $entityManager-&gt;flush();
  </code></pre>
  
  <p>But I'd like to be able just to "say" <code>$myEntityA-&gt;removeEntityB($entityB)</code> and not need to care about anything else. An advantage would be, that I can implement a method <code>EntityA#replaceEntityBs(ArrayCollection $entityBs)</code>, that simply removes all <code>EntityA#$entityBs</code> and replace them be the given elements.</p>
  
  <p><strong>Is it possible / How to remove elements of a collection directly from the <em>inverse side</em> of a relationship (of course without to pass the <code>EntityManager</code> into the entity)?</strong></p>