original_string: public function paginate($select, $resultSet = null)
      {
          $resultSet = $resultSet ?: $this->getResultSet();
          $adapter = new DbSelect($select, $this->getAdapter(), $resultSet);
          $paginator = new Paginator($adapter);
  
          $options = $this->getPaginatorOptions();
  
          if (isset($options['limit'])) {
              $paginator->setItemCountPerPage($options['limit']);
          }
  
          if (isset($options['page'])) {
              $paginator->setCurrentPageNumber($options['page']);
          }
  
          $paginator->setPageRange(5);
  
          return $paginator;
      }
code: public function paginate($select, $resultSet = null)
      {
          $resultSet = $resultSet ?: $this->getResultSet();
          $adapter = new DbSelect($select, $this->getAdapter(), $resultSet);
          $paginator = new Paginator($adapter);
  
          $options = $this->getPaginatorOptions();
  
          if (isset($options['limit'])) {
              $paginator->setItemCountPerPage($options['limit']);
          }
  
          if (isset($options['page'])) {
              $paginator->setCurrentPageNumber($options['page']);
          }
  
          $paginator->setPageRange(5);
  
          return $paginator;
      }
code_tokens: public function paginate ( $ select , $ resultSet = null ) { $ resultSet = $ resultSet ? : $ this -> getResultSet ( ) ; $ adapter = new DbSelect ( $ select , $ this -> getAdapter ( ) , $ resultSet ) ; $ paginator = new Paginator ( $ adapter ) ; $ options = $ this -> getPaginatorOptions ( ) ; if ( isset ( $ options [ 'limit' ] ) ) { $ paginator -> setItemCountPerPage ( $ options [ 'limit' ] ) ; } if ( isset ( $ options [ 'page' ] ) ) { $ paginator -> setCurrentPageNumber ( $ options [ 'page' ] ) ; } $ paginator -> setPageRange ( 5 ) ; return $ paginator ; }
docstring: Paginates the result set
  
  @param Select $select
  @param AbstractResultSet $resultSet
  @return Paginator
docstring_tokens: Paginates the result set