@param int $page
@param int $limit
@param array $with

@return StdClass
976499
public function getByPage($page = 1, $limit = 10, $with = array())
    {
        $result = new StdClass;
        $result->page = $page;
        $result->limit = $limit;
        $result->totalItems = 0;
        $result->items = array();

        $query = $this->make($with);
        $users = $query->skip($limit * ($page - 1))
            ->take($limit)
            ->get();
        $result->totalItems = $this->model->count();
        $result->items = $users->all();

        return $result;
    }
976512
public function page($page, $size = 25)
    {
        if (($page = (int) $page) < 0) 
        {
            $page = 0;
        }

        $this->limit = (int) $size;
        $this->offset = (int) $size * $page;

        return $this;
    }
774504
public function usersGroups($page = null, $limit = null)
    {
        $parameters = [];

        if (null !== $page) {
            $parameters['page'] = (int)$page;
        }
        if (null !== $limit) {
            $parameters['limit'] = (int)$limit;
        }

        /** @noinspection PhpUndefinedMethodInspection */
        return $this->client->makeRequest(
            '/user-groups',
            "GET",
            $parameters
        );
    }
613111
public function page($from = null, $limit = null, array $parameters = [])
    {
        return $this->rest_list($from, $limit, $parameters);
    }
1271749
private function hasNextPage(\Countable $queryResult, $limit, $page, $pageSize)
    {
        $count = $queryResult->count();
        if ($limit && $limit < $count) {
            $count = $limit;
        }

        return $count > ($page * $pageSize);
    }
522577
public function findAllWithoutFetchPaged($page = 0, $limit = 20) {
    $offset = $page * $limit;
    $results = $this->createQuery()
      ->setFirstResult($offset)
      ->setMaxResults($limit)
      ->execute();
    return $results;
  }
1296313
public function paginateResult(Driver $driver, $modelClass, $page, $limit)
    {
        if (100 < $limit) {
            $limit = 100;
        }

        $this->managerFactory->setModelClass($modelClass);

        return $this->managerFactory->getManager($driver)->paginate($page, $limit);
    }
1348317
public function limit($limit, $page = 1) {
        if($page >= 1) $this->page = $page;
        $this->limit = $limit;

        return $this;
    }
11370
public function page($page)
    {
        if (! $this->limit) return;
        $offset = $this->limit * ($page - 1);
        $this->offset($offset);
        return $this;
    }
423255
public function getByLimit(int $limit, array $where = [], array $with = [])
    {
        $query = $this->make($with);

        $query = $this->applyWhere($query, $where);

        return $query->take($limit)->get();
    }
738161
public function with($with)
    {
        if (! is_array($with)) {
            $with = func_get_args();
        }

        $this->with = $with;

        return $this;
    }
1008383
public function page ($page, $per_page = null)
	{
		$model = $this->model;

		if($per_page === null) { $per_page = $model::$per_page; }

		$this->offset($page * $per_page)->limit($per_page);

		return $this;
	}
225215
public function paginate($page, $limit)
    {
        if (!$this->getModelClass()) {
            throw new ModelNotFoundException('setModelClass');
        }

        /** @var EntityRepository $repository */
        $repository = $this->getManager()->getRepository($this->getModelClass());
        $queryBuilder = $repository->createQueryBuilder(Constants::MODEL_ALIAS);

        $filterList = new FilterQueryEvent();
        $filterList->setQueryBuilder($queryBuilder);
        $filterList->setAlias(Constants::MODEL_ALIAS);
        $filterList->setModelClass($this->getModelClass());

        $this->getEventSubscriber()->subscribe(Constants::FILTER_LIST, $filterList);

        $query = $filterList->getQueryBuilder()->getQuery();
        $query->useQueryCache(true);
        $query->useResultCache(true, $this->cacheLifetime, sprintf('%s_%s', $this->getModelClass(), serialize($query->getParameters()->toArray())));

        return $this->getPaginator()->paginate($query, $page, $limit);
    }
453739
public function findOrFail($id, array $with = [])
    {
        $query = $this->make($with);

        return $query->findOrFail($id);
    }
1088238
public function getPagedResults($limit = 50, $page = 0)
    {
        $dql = sprintf(self::DQL_GET_PAGED, AuditEvent::class);
        return $this->getPaginator($dql, $limit, $page);
    }
634753
public function getRootCategoriesPager($page = 1, $limit = 25, $criteria = [])
    {
        $page = 0 === (int) $page ? 1 : (int) $page;

        $queryBuilder = $this->getObjectManager()->createQueryBuilder()
            ->select('c')
            ->from($this->class, 'c')
            ->andWhere('c.parent IS NULL');

        $pager = new Pager($limit);
        $pager->setQuery(new ProxyQuery($queryBuilder));
        $pager->setPage($page);
        $pager->init();

        return $pager;
    }
1192218
public function listPerPage($familyCode, $limit = 10, $withCount = false, array $queryParameters = []): AkeneoResourcePageInterface
    {
        $page = $this->akeneoPimClient
            ->getFamilyVariantApi()
            ->listPerPage($familyCode, $limit, $withCount, $queryParameters);

        return $this->wrapperFactory
            ->createAkeneoPage($page);
    }