Create an query limit based on a page and a page size

@param int        $page
@param int         $size
@return self The current query builder.
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;
    }
612271
public function page($page = 1, $entries = null)
    {
        $page = (int)intval($page);

        $entries = (int)(isset($entries)
            ? $entries
            : ($this->builderCache->limit === false
                ? 5
                : $this->builderCache->limit
            )
        );

        $offset = ($page - 1) * $entries;

        $this->limit($entries, $offset);

        return $this;
    }
649116
public function limit($start, $size) {
        LimitImpl::limitWithOffset($this->context, $start, $size);
        return new ForUpdateRule($this->context);
    }
167734
public function paginate($limit = 25, $page = 0)
    {
        if ($limit > 0) {
            $this->queryBuilder->setMaxResults($limit);
        }

        if ($page > 0) {
            $this->queryBuilder->setFirstResult($page * $limit);
        }

        return $this;
    }
1307992
public function getByPage(
        int $page = 1,
        int $limit = 10,
        array $where = [],
        array $with = [],
        string $orderBy = null,
        string $order = 'desc'
    ) {
        $query = $this->make($with);

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

        if ($orderBy) {
            $query = $query->orderBy($orderBy, $order);
        }

        return $query->skip($limit * ($page - 1))
            ->take($limit)
            ->get();
    }
620482
public function paginate($page, $perPage = 30)
	{
		$this->set('from', max(0, $perPage * ($page - 1)));
		$this->set('size', $perPage);

		return $this;
	}
484192
public function setPage($page) {
        if (!is_numeric($page)) {
            $page = self::DEFAULT_PAGE;
        }

        if (0 == $page) {
            $page = self::DEFAULT_PAGE;
        }

        $this->page = $page;

        return $this;
    }
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;
    }
1131124
public function page($page, $size) {
        if ( $page <= 0 ) $page = 1;
        $offset = ($page-1) * $size;
        return $this->offset($offset, $size);
    }
487437
public function setPageSize($size)
    {
        if ( ! $size) {
            return $this->clearPageSize();
        }

        session()->put($this->getSessionKey(static::TYPE_PAGESIZE), $size);

        return $this;
    }
1238133
public function setPageSize($pagesize)
    {
        if($pagesize>0)
           $this->pagesize = $pagesize;
        else 
           $this->pagesize = 20;
        
        $this->currentpage = 1;
        // $this->Reload();
    }
157104
public function paginate(int $page = 1, int $perPage = 25) : self
    {
        return $this->limit($perPage, ($page - 1) * $perPage);
    }
1220507
public function page($page, $count)
    {
        $pagination = new Pagination($page, $count);
        $this->option->offset = $pagination->getLimitOffset();
        $this->option->limit = $count;
        return $this;
    }
208421
function set_pagesize($size)
    {
        $this->page_size = (int)$size;
        $this->ldap->set_vlv_page($this->list_page, $this->page_size);
    }
1286107
public function size(string $size): self
    {
        $comparator = new Comparator\NumberComparator($size);
        $filter = new Iterator\SizeRangeFilterIterator($this->getIterator(), [$comparator]);

        return new self(iterator_to_array($filter));
    }
839048
public function setCurrentPage($page)
    {
        $this->current_page = max(1, (int) $page);

        $this->current_record = ($this->current_page - 1) * $this->page_size;
    }
1106318
public function page( $page, $size = null ) {
        if( is_null( $size )) {
            $size = $this->maxPageSize();
        }

        if( $size > $this->maxPageSize() || $size <= 0 ) {
            throw new OutOfRangeException('$size has to be between 0 and ' . $this->maxPageSize() . ', was ' . $size );
        }

        if( $page < 0 ) {
            throw new OutOfRangeException('$page has to be 0 or greater');
        }

        return $this->request( $this->createPaginatedRequestQuery( $page, $size ) )->json();
    }