title: Doctrine Paginator with NativeQuery
body: <p>I'm trying to use Doctrine Paginator, but I'm HAVING TO use NativeQuery since I use a custom DB function in my Query.</p>
  
  <p>But I get this error:</p>
  
  <pre><code>Fatal error: Uncaught Error: Call to undefined method Doctrine\ORM\NativeQuery::getFirstResult()
  </code></pre>
  
  <p>My code so far is:</p>
  
  <pre><code>$sql = "SELECT std_modulos_aulas.idaula, std_modulos_aulas.idmodulo, conteudo, std_modulos_aulas.titulo
              FROM  uov.std_modulos_aulas
              INNER JOIN uov.std_modulos ON std_modulos_aulas.idmodulo = std_modulos.idmodulo
              INNER JOIN uov.std_cursos ON std_cursos.idcurso = std_modulos.idcurso
              WHERE std_modulos.publicar = 's' AND std_modulos.excluido = 'n' AND std_modulos_aulas.publicar = 's' AND std_cursos.idcurso = ".$curso." AND academico.strip_tags(LOWER(std_modulos_aulas.conteudo)) LIKE '".$termo."'
              ORDER BY std_modulos.ordem ASC, std_modulos_aulas ASC";
  
  $rsm = new ResultSetMapping;
  
  $rsm-&gt;addScalarResult('idaula', 'idaula');
  $rsm-&gt;addScalarResult('idmodulo', 'idmodulo');
  $rsm-&gt;addScalarResult('conteudo', 'conteudo');
  $rsm-&gt;addScalarResult('titulo', 'titulo');
  
  $query = $this-&gt;em-&gt;createNativeQuery($sql, $rsm);
  
  return new Paginator($query, $fetchJoinCollection = false);
  </code></pre>
  
  <p>Any help would be nice. I've already tried using QueryBuilder, but my strip_tags function isn't working in that way. The old topics couldn't help me.</p>