src/Sulu/Component/Content/SmartContent/PageDataProvider.php
private function loadPaginated(array $options, $limit, $page, $pageSize)
    {
        $pageSize = intval($pageSize);
        $offset = ($page - 1) * $pageSize;

        $position = $pageSize * $page;
        if (null !== $limit && $position >= $limit) {
            $pageSize = $limit - $offset;
            $loadLimit = $pageSize;
        } else {
            $loadLimit = $pageSize + 1;
        }

        return $this->contentQueryExecutor->execute(
            $options['webspaceKey'],
            [$options['locale']],
            $this->contentQueryBuilder,
            true,
            -1,
            $loadLimit,
            $offset
        );
    }
private function loadPaginated(array $options, $limit, $page, $pageSize)
    {
        $pageSize = intval($pageSize);
        $offset = ($page - 1) * $pageSize;

        $position = $pageSize * $page;
        if (null !== $limit && $position >= $limit) {
            $pageSize = $limit - $offset;
            $loadLimit = $pageSize;
        } else {
            $loadLimit = $pageSize + 1;
        }

        return $this->contentQueryExecutor->execute(
            $options['webspaceKey'],
            [$options['locale']],
            $this->contentQueryBuilder,
            true,
            -1,
            $loadLimit,
            $offset
        );
    }
private function loadPaginated ( array $ options , $ limit , $ page , $ pageSize ) { $ pageSize = intval ( $ pageSize ) ; $ offset = ( $ page - 1 ) * $ pageSize ; $ position = $ pageSize * $ page ; if ( null !== $ limit && $ position >= $ limit ) { $ pageSize = $ limit - $ offset ; $ loadLimit = $ pageSize ; } else { $ loadLimit = $ pageSize + 1 ; } return $ this -> contentQueryExecutor -> execute ( $ options [ 'webspaceKey' ] , [ $ options [ 'locale' ] ] , $ this -> contentQueryBuilder , true , - 1 , $ loadLimit , $ offset ) ; }
Load paginated data.

@param array $options
@param int $limit
@param int $page
@param int $pageSize

@return array
Load paginated data .