title: migrating sql query controller symfony4
body: <p>hello I'm migrating from <code>symfony 2.5</code> to <code>4.1</code> and I find myself with a mishap in the controller, before <code>mibundle:miaccion</code> now how can I do?</p>
  
  <pre><code>$repositoryEstado = $em-&gt;getRepository('MiBundle:miaction');        
  $queryEstado = $repositoryEstado-&gt;createQueryBuilder('alias')
                                  -&gt;where('alias.id = :id')
                                  -&gt;setParameter('id', $idEstado)
                                  -&gt;andWhere('alias.estado = :estado')
                                  -&gt;setParameter('estado', true)
                                  -&gt;getQuery();
  $resultEstado = $queryEstado-&gt;getOneOrNullResult();
  </code></pre>