title: How to perform a join query using Symfony and Doctrine Query Builder
body: <p>I have two entities which are connected through a 1:1 relationship, e.g: <code>MyEntity.idRelatedEntity</code>
  I want to create a Doctrine query where I can retrieve data from <code>MyEntity</code> depending on a value from a certain column in <code>RelatedEntity</code>. Something like this (it doesn't work of course):</p>
  
  <pre><code>$entity = $em
      -&gt;getRepository('MyBundle:RelatedEntity')
      -&gt;createQueryBuilder('e')
      -&gt;leftJoin('MyBundle:RelatedEntity', 'r')
      -&gt;where('r.foo = 1')
      -&gt;getQuery()
      -&gt;getResult();
  </code></pre>
  
  <p>Any help would be much appreciated :)</p>