Wheter next link is needed for the current resource set (feed)
being serialized.

@param int $resultSetCount Number of entries in the current
resource set

@return bool true if the feed must have a next page link
540032
protected function needNextPageLink($resultSetCount)
    {
        $currentResourceSet = $this->getCurrentResourceSetWrapper();
        $recursionLevel = count($this->getStack()->getSegmentNames());
        $pageSize = $currentResourceSet->getResourceSetPageSize();

        if (1 == $recursionLevel) {
            //presence of $top option affect next link for root container
            $topValueCount = $this->getRequest()->getTopOptionCount();
            if (null !== $topValueCount && ($topValueCount <= $pageSize)) {
                return false;
            }
        }
        return $resultSetCount == $pageSize;
    }
398490
private function setTotalCount(ResultSet $result): void
    {
        $this->totalCount = $result->getTotalCount() - $this->startingOffset;
        $this->totalCount = $this->totalCount > 0 ? $this->totalCount : 0;

        if ($this->maxTotalCount !== null && $this->totalCount >= $this->maxTotalCount) {
            $this->totalCount = $this->maxTotalCount;
        }
    }
815010
public function setRowCount($rowCount)
    {
        if ($rowCount instanceof \Doctrine_Query) {
            $sql = $rowCount->getSql();

            if (false === strpos($sql, self::ROW_COUNT_COLUMN)) {
                throw new \Zend_Paginator_Exception('Row count column not found');
            }

            $result = $rowCount->fetchOne()->toArray();

            $this->_rowCount = count($result) > 0 ? $result[self::ROW_COUNT_COLUMN] : 0;
        } else if (is_integer($rowCount)) {
            $this->_rowCount = $rowCount;
        } else {
            throw new \Zend_Paginator_Exception('Invalid row count');
        }

        return $this;
    }
213261
public function findByFeeds($feeds, $offset_start = null, $how_many = null)
    {
        $dql = 'SELECT f FROM Phraseanet:FeedEntry f
                WHERE f.feed IN (:feeds) order by f.updatedOn DESC';

        $query = $this->_em->createQuery($dql);
        $query->setParameter('feeds', $feeds);

        if (null !== $offset_start && 0 !== $offset_start) {
            $query->setFirstResult($offset_start);
        }
        if (null !== $how_many) {
            $query->setMaxResults($how_many);
        }

        return $query->getResult();
    }
442483
protected function getListBlobFields(&$resultSet,$field='') {
        if(!empty($this->blobFields)) {
            foreach ($resultSet as $key=>$result){
                $result =   $this->getBlobFields($result,$field);
                $resultSet[$key]    =   $result;
            }
        }
        return $resultSet;
    }
370663
function NextRecordSet()
	{
		if (!sqlsrv_next_result($this->_queryID)) return false;
		$this->_inited = false;
		$this->bind = false;
		$this->_currentRow = -1;
		$this->Init();
		return true;
	}
1030389
private ResultSet getNextResultSet() throws SQLException {
        ResultSet result = null;

        while (stmt.getMoreResults() == true) {

            // when gerMoreResults are returned - some drivers close previous ResultSets - therefore we cannot read them again.
            if (this.type == Type.UPDATE_SCROLL || this.type == Type.READ_ONLY_SCROLL) {
                throw new MjdbcSQLException("Lazy cache scroll does not support Multiple ResultSets. Pleae use" +
                        "non-scrollable lazy handlers or cached output handlers.");
            }

            if (closedResultSet.contains(result) == false) {
                result = stmt.getResultSet();
                break;
            }
        }

        return result;
    }
814635
public function rowCounts()
    {
        if (!$this->rowCounts) {
            foreach ($this->data['resultSets'] as $resultSet) {
                $this->rowCounts[] = $resultSet['stats']['rowCountExact'];
            }
        }

        return $this->rowCounts;
    }
118010
private synchronized boolean loadNextResults() {
        if ( atEndOfResults() )
            return false;

        do {
            nextResults.addAll(fetchNextPage());
        } while ( !atEndOfResults() && nextResults.isEmpty() );

        return !nextResults.isEmpty();
    }
387296
public function setRowsCount($rowsCount, $colsCount=NULL, $force=false) {
		$count=$this->count();
		if ($rowsCount < 2 && $force === false) {
			for($i=$count; $i < $colsCount; $i++) {
				$this->addItem(new HtmlGridCol("col-" . $this->identifier . "-" . $i));
			}
		} else {
			if ($this->hasOnlyCols($count)) {
				$tmpContent=$this->content;
				$item=$this->addItem($colsCount);
				$item->setContent($tmpContent);
				$this->content=array ();
				$count=1;
			}
			for($i=$count; $i < $rowsCount; $i++) {
				$this->addItem($colsCount);
			}
		}
		return $this;
	}
638462
private function parseFacetsIntoObjects(SearchResultSet $resultSet)
    {
        // Make sure we can access the facet configuration
        if (!$resultSet->getUsedSearchRequest() || !$resultSet->getUsedSearchRequest()->getContextTypoScriptConfiguration()) {
            return $resultSet;
        }

        // Read the response
        $response = $resultSet->getResponse();
        if (!is_object($response->facet_counts) && !is_object($response->facets)) {
            return $resultSet;
        }

        /** @var FacetRegistry $facetRegistry */
        $facetRegistry = $this->getFacetRegistry();
        $facetsConfiguration = $resultSet->getUsedSearchRequest()->getContextTypoScriptConfiguration()->getSearchFacetingFacets();

        foreach ($facetsConfiguration as $name => $options) {
            if (!is_array($options)) {
                continue;
            }
            $facetName = rtrim($name, '.');
            $type = !empty($options['type']) ? $options['type'] : '';

            $parser = $facetRegistry->getPackage($type)->getParser();
            $facet = $parser->parse($resultSet, $facetName, $options);
            if ($facet !== null) {
                $resultSet->addFacet($facet);
            }
        }

        $this->applyRequirements($resultSet);

        return $resultSet;
    }
666303
public function getSimple(bool $isCount = false): \Assurrussa\GridView\Helpers\GridViewResult
    {
        $gridViewResult = $this->_getGridView($isCount);
        $gridViewResult->data = $this->pagination->getSimple($this->page, $this->limit, $isCount);
        $gridViewResult->pagination = $this->_getPaginationRender();
        $gridViewResult->simple = true;

        return $gridViewResult;
    }
176321
public function eagerlyResultSet(&$resultSet, $relation, $subRelation, $closure)
    {
        $localKey   = $this->localKey;
        $foreignKey = $this->foreignKey;

        $pk    = $resultSet[0]->getPk();
        $range = [];
        foreach ($resultSet as $result) {
            // 获取关联外键列表
            if (isset($result->$pk)) {
                $range[] = $result->$pk;
            }
        }

        if (!empty($range)) {
            // 查询关联数据
            $data = $this->eagerlyManyToMany([
                ['pivot.' . $localKey, 'in', $range],
            ], $relation, $subRelation, $closure);

            // 关联属性名
            $attr = Db::parseName($relation);

            // 关联数据封装
            foreach ($resultSet as $result) {
                if (!isset($data[$result->$pk])) {
                    $data[$result->$pk] = [];
                }

                $result->setRelation($attr, $this->resultSetBuild($data[$result->$pk]));
            }
        }
    }
293319
public function nextResult()
	{
		try {
			return $this->_statement->nextRowset();
		} catch ( PDOException $e ) {
			throw new MW_DB_Exception( $e->getMessage(), $e->getCode(), $e->errorInfo );
		}
	}
965722
function Next()
    {
    	if ($this->UnableToCache)
    	{
    		require_once("verysimple/Util/ExceptionFormatter.php");
    		$info = ExceptionFormatter::FormatTrace(debug_backtrace());
    		$this->_phreezer->Observe("(DataSet.Next: unable to cache query with cursor) " . $info . "  " . $this->_sql,OBSERVE_DEBUG);

    		// use this line to discover where an uncachable query is coming from
    		// throw new Exception("WTF");

    		// stop this warning from repeating on every next call for this dataset
    	    $this->UnableToCache = false;
    	}

        $this->_verifyRs();

		$this->_current = null;
		$this->_counter++;

        if ($this->_eof)
        {
			if (!$this->_no_exception)
				throw new Exception("EOF: This is a forward-only dataset.");
        }

        if ($row = $this->_phreezer->DataAdapter->Fetch($this->_rs))
        {
            $this->_current = $this->_getObject($row);
			$this->_last = $this->_current;
		}
        else
        {
            $this->_eof = true;
        }

		return $this->_current;
    }
858833
@Override
    public boolean next() throws SQLException {
        notClosed();
        if (!this.hasNext()) {
            this.row = null;
            this.currentValue = null;
            return false;
        }

        this.row = rowIter.nextRow();
        return true;
    }
92972
protected function processResponse(ResultSet $result = null)
    {
        $this->hits = array();
        if (is_null($result)) {
            return null;
        }
        $this->collectHits($result);
        $this->collectAggregations($result);
    }