title: Symfony2/Doctrine2 innerJoin using QueryBuilder
body: <p>I'm trying to build a <code>innerJoin</code> query using <code>Doctrine2/QueryBuilder</code>.</p>
  
  <pre><code>$repo =  $this-&gt;getDoctrine()
          -&gt;getRepository('MyBundle:Models');
  $query = $repo-&gt;createQueryBuilder('m')
          -&gt;where('m.id = :id')
          -&gt;setParameter('id', $id);
  </code></pre>
  
  <p>Doctrine says:</p>
  
  <blockquote>
    <p>A join always belongs to one part of the from clause. This is why you
    have to specify the alias of the FROM part the join belongs to as the
    first argument.</p>
    
    <p>As a second and third argument you can then specify the name and alias
    of the join-table and the fourth argument contains the ON clause.</p>
  </blockquote>
  
  <p>Ex.</p>
  
  <pre><code>$queryBuilder
  -&gt;innerJoin('u', 'phonenumbers', 'p', 'u.id = p.user_id');
  </code></pre>
  
  <p>What I can't understand is that <code>'phonenumbers'</code> table is referencing to <code>Entity Name</code> or <code>DB Table Name</code>.</p>
  
  <p>What I actually want is, is there any way to explicitly refer to entity like</p>
  
  <p><code>innerJoin('u', 'MyBundle:phonenumbers', 'p', 'u.id = p.user_id')</code>?</p>
  
  <p>It's a bit confusing when it joins just like that. Can please someone explain that to me?</p>
  
  <p>Help!!</p>