title: WHERE ... IN query with sub-query in Doctrine queryBuilder or equivalent
body: <p>In my Symfony 4 project I have a <code>User</code> entity and a <code>UserRepository</code>.
  I'm trying to implement the equivalent of this <code>SQL</code> query in the <code>QueryBuilder</code>(Doctrine 2) or even in <code>DQL</code>.</p>
  
  <pre><code>SELECT * FROM user WHERE account_manager_id IN (SELECT id FROM user WHERE account_manager_id = :managerAdminId AND roles LIKE '%ROLE_MANAGER%')
  </code></pre>
  
  <p>Or maybe use a different syntax.</p>
  
  <p>I tried different things, but couldn't figure out how to write the WHERE ... IN with the sub-query.</p>
  
  <p>This is all I could come up with, which I don't like because it fires multpiple queries for something I could do with a single one:</p>
  
  <pre><code>    //App\Repository\UserRepository
  
      public function getPublishersOfManagers($managerAdminId)
      {
          //SELECT * FROM user WHERE account_manager_id IN (SELECT id FROM user WHERE account_manager_id = :managerAdminId AND roles LIKE '%ROLE_MANAGER%')
  
          $managerIds = $this-&gt;createQueryBuilder('u')
                      -&gt;select('u.id')
                      -&gt;where('u.roles LIKE :role')
                      -&gt;setParameter('role' , '%ROLE_MANAGER%')
                      -&gt;andWhere('u.accountManager = :managerAdminId')
                      -&gt;setParameter('managerAdminId' , $managerAdminId)
                      -&gt;getQuery()-&gt;getArrayResult();
  
          $publishers = [];
  
          foreach ($managerIds as $id) {
  
              $publishers[] = $this-&gt;createQueryBuilder('u')
                      -&gt;select('u')
                      -&gt;where('u.roles LIKE :role')
                      -&gt;setParameter('role' , '%ROLE_PUBLISHER%')
                      -&gt;andWhere('u.accountManager = :managerAdminId')
                      -&gt;setParameter('managerAdminId' , $id)
                      -&gt;getQuery()-&gt;getResult();
          }
  
          return $publishers;
      }
  </code></pre>