title: Error with KNPpaginator and Join Query with Symfony3
body: <p>Iam developing a web application for a schoolwork in symfony 3, i need to show a table and i need that this table shows only 5 results and also sort the columns with the knppaginator.
  im using the following code:</p>
  
  <pre><code>$em = $this-&gt;getDoctrine()-&gt;getManager()-&gt;createQueryBuilder(); 
      $dql = $em
      -&gt;select( 'w.id, c.nombre AS Cliente, u.nombre AS  Usuario, w.titulo AS Titulo, w.descripcion AS Descripcion, w.fecharegistro AS FechaRegistro, w.fechainicio AS FechaInicio, w.fechaentrega AS FechaEntrega, w.prioridad AS prioridad, w.terminado AS terminado')
      -&gt;add('from','ClientBundle:Client c')
      -&gt;innerJoin('WorkBundle:Work', 'w', 'WITH', 'c.id=w.iDCliente')
      -&gt;innerJoin('UserBundle:User', 'u', 'WITH', 'w.iDUsuario=u.id')
      -&gt;where('w.terminado=0 and u.nombre= :name')-&gt;setParameter('name',$session-&gt;get('name'))
      -&gt;getQuery();
      $works = $dql-&gt;getResult();
  
  
   $paginator = $this-&gt;get('knp_paginator');
  
          $pagination = $paginator-&gt;paginate($works, $request-&gt;query-&gt;getInt('page',1),5);
  
      return $this-&gt;render("UserBundle:User:main.html.twig",array("vacio"=&gt;$works,"fechaActual"=&gt;$fechaActual,"name"=&gt;$session-&gt;get("name"),"pagination"=&gt;$pagination));
  </code></pre>
  
  <p>if i dont use the "getResult()", the paginator gets the query directly, so knppaginator can sort the columns but cant paginate them, but if i use the "getResult()" method the table is correctly paginated but the table cant be sorted</p>