title: How can I get data from 2 tables in Doctrine?
body: <p>I need to get data from 2 tables in Doctrine (Symfony 4). </p>
  
  <p>I've create Entity and repository for tables. </p>
  
  <p>Here sql code</p>
  
  <pre><code>SELECT * 
    FROM wp_terms AS t
    LEFT JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id
   WHERE tt.taxonomy = 'nav_menu';
  </code></pre>
  
  <pre><code>#Repository/WpTermsRepository.php
  #Simple query not working
  public function findOneBySomeField($value): ?WpTerms
      {
          return $this-&gt;createQueryBuilder('w')
              -&gt;andWhere('w.name = :val')
              -&gt;setParameter('val', $value)
              -&gt;getQuery()
              -&gt;getOneOrNullResult()
              ;
      }
  </code></pre>
  
  <p>returns An exception occurred in driver: SQLSTATE[HY000] [2002] ���</p>