title: Symfony2 - Doctrine : setMaxResults() doesn't work
body: <p>I have one problem with doctrine and a custom query in my repository. I work on a website including premium account.
  With these accounts you can get not limit with the list member result for example. If you don't have the premium account, the result list is limited to 10 results.</p>
  
  <p>So this is my custom Query : </p>
  
  <pre><code>/**
   * Avec cette fonction on obtient la liste de tous les membres
   * en utilisant une pagination
   * @param int $page
   * @param $limitResultPremium
   * @return Paginator
   */
  public function getAllUser($page = 1,$maxResultPerPage = 6,$limitResultPremium = 10) {
  
      $query = $this-&gt;createQueryBuilder('u')
          -&gt;select('u')
          -&gt;where('u.enabled = true')
          -&gt;andWhere('u.dCreated &lt;= '. "'".date("Y-m-d H:i:s", time())."'")
          -&gt;orderBy('u.dCreated')
          -&gt;setMaxResults($limitResultPremium)
      ;
  
      $query-&gt;setFirstResult(($page-1) * $maxResultPerPage)
          -&gt;setMaxResults($maxResultPerPage);
  
  
      return new Paginator($query);
  }
  </code></pre>
  
  <p>As you can see, I use paginator to paginate my results page. But I want to use the function <code>setMaxResults()</code> and it doesn't work.  I have also the max result corresponding to my query (in my case I get 11 results, and I want to only get 10...)</p>
  
  <p>If someone can help me... Sorry for my english ! Thanks in advance</p>