title: Symfony Doctrine Pagination
body: <p>I have entity users, example count 90355 and I need get by 100 users and do something logic with this user. then next 100 use, this is I have but when I findAll my server dropdown how to solved this problem ?</p>
  
  <pre><code>public function find()
  {
      $developers = $this-&gt;em-&gt;getRepository('ArtelProfileBundle:Users')-&gt;findBy(array(), array('id' =&gt; 'desc'));
      foreach ($developers as $developer) {
         $this-&gt;getApiFullContact($developer);
      }
      return true;
  }
  </code></pre>
  
  <p>I think like this function but setFirstResult and setMaxResults dynamics variable ? </p>
  
  <pre><code>    public function getPaginationUser()
  {
      $qb = $this-&gt;getEntityManager()-&gt;createQueryBuilder('d');
      $qb
          -&gt;select('d')
          -&gt;from('ArtelProfileBundle:Users', 'd')
          -&gt;setFirstResult(0)
          -&gt;setMaxResults(100)
          -&gt;orderBy('d.id', 'DESC')
          -&gt;getQuery()
          -&gt;getResult()
      ;
      $query = $qb-&gt;getQuery();
      $results = $query-&gt;getResult();
  
      return $results;
  }
  </code></pre>
  
  <p>how do this iteration ? </p>