title: How to create other columns inside the intermediary table of a many-to-many relationship in Symfony?
body: <p>There are two entities having a many-to-many relationship :</p>
  <pre><code>/**
   * @ORM\Entity(repositoryClass=KbFavorisRepository::class)
   */
  class KbFavoris
  {
      /**
       * @ORM\Id()
       * @ORM\GeneratedValue()
       * @ORM\Column(type=&quot;integer&quot;)
       */
      private $id;
  
      ...
  
      /**
       * @var \Doctrine\Common\Collections\Collection|KbCollection[]
       *
       * @ORM\ManyToMany(targetEntity=&quot;KbCollection&quot;, mappedBy=&quot;kb_favoris&quot;,cascade={&quot;persist&quot;})
       */
      protected $collection;
  
      ...
  
  }
  
  /**
   * @ORM\Entity(repositoryClass=KbCollectionRepository::class)
   */
  class KbCollection
  {
      /**
       * @ORM\Id()
       * @ORM\GeneratedValue()
       * @ORM\Column(type=&quot;integer&quot;)
       * @JMS\Groups({&quot;list_collection&quot;})
       */
      private $id;
  
      ...
  
      /**
       * @var KbFavoris
       * @ORM\ManyToMany(targetEntity=&quot;KbFavoris&quot;,inversedBy=&quot;collection&quot;, cascade={&quot;remove&quot;})
       * @ORM\JoinTable(
       *  name=&quot;kb_favoris_collection&quot;,
       *  joinColumns={
       *      @ORM\JoinColumn(name=&quot;collection_id&quot;, referencedColumnName=&quot;id&quot;)
       *  },
       *  inverseJoinColumns={
       *      @ORM\JoinColumn(name=&quot;favoris_id&quot;, referencedColumnName=&quot;id&quot;)
       *  }
       * )
       */
      private $kb_favoris;
  
      ...
  
  }
  </code></pre>
  <p>How to add another column inside the intermediary table of the many-to-many relationship ?</p>