lib/Elastica/Scroll.php
protected function _setScrollId(ResultSet $resultSet)
    {
        if (0 === $this->currentPage) {
            $this->totalPages = $resultSet->count() > 0 ? \ceil($resultSet->getTotalHits() / $resultSet->count()) : 0;
        }

        $this->_currentResultSet = $resultSet;
        ++$this->currentPage;
        $this->_nextScrollId = $resultSet->getResponse()->isOk() && $resultSet->count() > 0 ? $resultSet->getResponse()->getScrollId() : null;
    }
protected function _setScrollId(ResultSet $resultSet)
    {
        if (0 === $this->currentPage) {
            $this->totalPages = $resultSet->count() > 0 ? \ceil($resultSet->getTotalHits() / $resultSet->count()) : 0;
        }

        $this->_currentResultSet = $resultSet;
        ++$this->currentPage;
        $this->_nextScrollId = $resultSet->getResponse()->isOk() && $resultSet->count() > 0 ? $resultSet->getResponse()->getScrollId() : null;
    }
protected function _setScrollId ( ResultSet $ resultSet ) { if ( 0 === $ this -> currentPage ) { $ this -> totalPages = $ resultSet -> count ( ) > 0 ? \ ceil ( $ resultSet -> getTotalHits ( ) / $ resultSet -> count ( ) ) : 0 ; } $ this -> _currentResultSet = $ resultSet ; ++ $ this -> currentPage ; $ this -> _nextScrollId = $ resultSet -> getResponse ( ) -> isOk ( ) && $ resultSet -> count ( ) > 0 ? $ resultSet -> getResponse ( ) -> getScrollId ( ) : null ; }
Prepares Scroll for next request.

@param ResultSet $resultSet
Prepares Scroll for next request .