title: How to Mapping from JoinTable with Doctrine
body: <p>I have the following tables in my ERM/database:</p>
  
  <p><strong>card</strong>, <strong>expansion</strong> and <strong>card_expansion</strong><br>
  <code>ManyToMany</code>-Relationship between card and expansion. A card can be in many expansions and an expansion can hold a many of cards.</p>
  
  <p><strong>collection</strong><br>
  Description of how many cards from which expansion are needed. Card A from Expansion B is needed 3 times. So there's a <code>OneToMany</code> relationship to <code>card_expansion</code>.</p>
  
  <p>I want to map these relations in my Entities-objects using Doctrine. Mapping between cards and expansions is no problem. 
  But since the <code>card_expansion</code> table isn't mapped directly by an entity, I don't have a clue how to access it from my <code>Collection</code> entity or which annotation I have to use to build up that connection correctly...</p>
  
  <p>What do I need to map to get this working? </p>
  
  <p>Here's the code of my <code>Expansion</code> entity:</p>
  
  <pre><code>/**
   * @Entity
   * @Table(name="expansion")
   */
  class Expansion {
  
  ...
      /**
       * @ManyToMany(targetEntity="Card")
       * @JoinTable(name="card_expansion",
       *     joinColumns={@JoinColumn(name="_expansion", referencedColumnName="id")},
       *     inverseJoinColumns={@JoinColumn(name="_card", referencedColumnName="id", unique=true)})
       */
      private $cards;
  
      public function __construct () {
          $this-&gt;cards = new ArrayCollection();
  
      }
  </code></pre>
  
  <p>and here's my <code>Collection</code> Entity</p>
  
  <pre><code>/**
   * @Entity
   * @Table(name="collection")
   */
  class Collection{
  
   /**
       * @OneToMany(targetEntity="???")
       * @JoinTable(name="card_in_expansion")
       */
      private $card_in_expansion;
  </code></pre>