title: Doctrine many to many query builder
body: <p>I have a <code>Contacts</code> entity and a <code>Users</code> entity with <em>many-to-many</em> relationship, in order to setup favorite contacts.</p>
  <p>I try to build a query to find if a <em>contact</em> is a favorite of a <em>user</em>. Doctrine returns the following error:</p>
  <pre><code>[Semantical Error] line 0, col 81 near 'favoris = :user': Error: Invalid PathExpression. StateFieldPathExpression or SingleValuedAssociationField expected.
  </code></pre>
  <p>Here is my query :</p>
  <pre><code>    public function isFavori(users $user, contacts $contacts) {
  
      $em = $this-&gt;getEntityManager();
      $qb = $em-&gt;createQueryBuilder('c');
      $query = $qb
          -&gt;select('1')
          -&gt;from('contactsBundle:contacts', 'c')
          -&gt;join('contactsBundle:users', 'f', 'WITH', 'c.favoris = :user')
          -&gt;where('c = :contact')
          -&gt;setParameter('user', $user)
          -&gt;setParameter('contact', $contacts)
      ;
      $querystring = $qb-&gt;getQuery();
      return $qb-&gt;getQuery()-&gt;getResult();
  
  }
  </code></pre>
  <p>Here is the join annotation from the <code>Contact</code> entity:</p>
  <pre><code>/**
   * @ORM\ManyToMany(targetEntity=&quot;Curuba\contactsBundle\Entity\users&quot;, inversedBy=&quot;contactsfavoris&quot;)
   *
   */
  private $favoris;
  </code></pre>