Set pagination
@param boolean $paginate
@return $this
327696
public function setPaginate($paginate, $itemCountPerPage = null, array $paramsKeys = null)
    {
        $this->paginate = (bool) $paginate;
        if ($itemCountPerPage !== null) {
            $this->setItemCountPerPage($itemCountPerPage);
        }
        if (is_array($paramsKeys)) {
            $this->setParamsKeys($paramsKeys);
        }
        return $this;
    }
271167
public function setPage(Page $page)
    {
        $this->_page = $page;
        $page->setMainSection($this);

        return $this;
    }
298928
public function setPage($pagenum)
    {
        if($pagenum > $this->getPages()) {
            $pagenum = $this->getPages();
        }
        if($pagenum < 1) {
            $pagenum = 1;
        }

        $this->pagenum = $pagenum;
        return $this;
    }
243083
public function paging($pageNum, $pageSize) {
        $offset = ($pageNum - 1) * $pageSize;
        $this->statementContext->setLimit("{$offset}, {$pageSize}");
        return $this;
    }
484235
protected function setPagerListUser()
    {
        $options = $this->query_filter;
        $options['count'] = true;

        $pager = array(
            'query' => $this->query_filter,
            'total' => (int) $this->user->getList($options)
        );

        return $this->data_limit = $this->setPager($pager);
    }
1197806
protected function setPagerListOrder()
    {
        $conditions = $this->query_filter;
        $conditions['count'] = true;

        $pager = array(
            'query' => $this->query_filter,
            'total' => (int) $this->order->getList($conditions)
        );

        return $this->data_limit = $this->setPager($pager);
    }
1158067
public function applyRequestQueryParams(AbstractPaginator $paginator)
	{
		// Pass in any additional query variables
		foreach (
			array_except(
				Request::instance()->query->all(), [
					self::PAGINATION_CURRENT_PAGE,
					self::PAGINATION_PER_PAGE
				]
			) as $key => $value
		) {
			$paginator->addQuery($key, $value);
		}
		// Add our "per page" pagination parameter to the constructed URLs
		$paginator->addQuery(self::PAGINATION_PER_PAGE, $paginator->perPage());
	}
360370
public function setCurrentPageNumber($pageNumber)
    {
        $this->currentPageNumber = (int) $pageNumber;
        $this->currentItems      = null;
        $this->currentItemCount  = null;

        return $this;
    }
1055230
protected function setPagerListReview()
    {
        $conditions = $this->query_filter;
        $conditions['count'] = true;

        $pager = array(
            'query' => $this->query_filter,
            'total' => (int) $this->review->getList($conditions)
        );

        return $this->data_limit = $this->setPager($pager);
    }
597400
protected function addPaginationHeaders($pagination)
    {
        $links = [];
        foreach ($pagination->getLinks(true) as $rel => $url) {
            $links[] = "<$url>; rel=$rel";
        }

        $this->response->setHeader($this->totalCountHeader, $pagination->totalCount);
        $this->response->setHeader($this->pageCountHeader, $pagination->getPageCount());
        $this->response->setHeader($this->currentPageHeader, $pagination->getPage() + 1);
        $this->response->setHeader($this->perPageHeader, $pagination->pageSize);
        $this->response->setHeader('Link', implode(', ', $links));
    }
1371063
def set_paginator
      posts_scope = Post.published

      if @tag
        posts_scope = posts_scope.joins(:tags).where("#{Tag.table_name}.name = ?", @tag)
      end

      @paginator = Paginator.new(
        posts_scope,
        :page     => (params[:page] || 1),
        :per_page => Blogo.config.posts_per_page,
        :size     => Blogo.config.paginator_size)
    end
1235801
protected function _setData() {
        if (($this->_currentPage == 0)) {
            $linkDisabled = false;
        }
        else {
            $linkDisabled = true;
        }

        if ($this->_currentPage < 1) {
            $this->_currentPage = 1;
        }

        $this->_nbrPage = ceil($this->_entry / $this->_byPage);

        if ($this->_nbrPage == 0) {
            $this->_nbrPage = 1;
        }

        if ($this->_currentPage > $this->_nbrPage) {
            $this->_currentPage = $this->_nbrPage;
        }

        if ($this->_currentPage == 1) {
            $this->_paginationFirstBefore = false;
        }

        if ($this->_currentPage == $this->_nbrPage) {
            $this->_paginationLastAfter = false;
        }

        //useless to hide links if there isn't pages enough
        if ($this->_paginationCut == false || $this->_paginationCut > $this->_nbrPage) {
            for ($i = 1; $i <= $this->_nbrPage; $i++) {
                if ($i == $this->_currentPage && $linkDisabled != false) {
                    $this->_paginationList[$i] = false;
                }
                else {
                    $this->_paginationList[$i] = preg_replace('#\{page\}#isU', $i, $this->_url);
                }
            }
        }
        else {
            if ($this->_paginationCut > (($this->_nbrPage / 2) - 2)) {
                $this->_paginationCut = intval(($this->_nbrPage / 2));
            }

            if ($this->_paginationCut < 1) {
                $this->_paginationCut = 1;
            }

            if (($this->_currentPage - $this->_paginationCut) > 0 && ($this->_currentPage + $this->_paginationCut) < $this->_nbrPage) {
                for ($i = $this->_currentPage - $this->_paginationCut; $i <= $this->_currentPage + $this->_paginationCut; $i++) {
                    if ($i == $this->_currentPage && $linkDisabled != false) {
                        $this->_paginationList[$i] = false;
                    }
                    else {
                        $this->_paginationList[$i] = preg_replace('#\{page\}#isU', $i, $this->_url);
                    }
                }
            }
            elseif (($this->_currentPage - $this->_paginationCut) > 0 && ($this->_currentPage + $this->_paginationCut) >= $this->_nbrPage) {
                for ($i = $this->_currentPage - $this->_paginationCut; $i <= $this->_nbrPage; $i++) {
                    if ($i == $this->_currentPage && $linkDisabled != false) {
                        $this->_paginationList[$i] = false;
                    }
                    else {
                        $this->_paginationList[$i] = preg_replace('#\{page\}#isU', $i, $this->_url);
                    }
                }
            }
            elseif (($this->_currentPage - $this->_paginationCut) <= 0 && ($this->_currentPage + $this->_paginationCut) < $this->_nbrPage) {
                for ($i = 1; $i <= $this->_currentPage + $this->_paginationCut; $i++) {
                    if ($i == $this->_currentPage && $linkDisabled != false) {
                        $this->_paginationList[$i] = false;
                    }
                    else {
                        $this->_paginationList[$i] = preg_replace('#\{page\}#isU', $i, $this->_url);
                    }
                }
            }
            else {
                for ($i = 1; $i <= $this->_nbrPage; $i++) {
                    if ($i == $this->_currentPage && $linkDisabled != false) {
                        $this->_paginationList[$i] = false;
                    }
                    else {
                        $this->_paginationList[$i] = preg_replace('#\{page\}#isU', $i, $this->_url);
                    }
                }
            }
        }
    }
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;
    }
1127346
protected function setPagerlListCart()
    {
        $options = $this->query_filter;
        $options['count'] = true;
        $total = (int) $this->cart->getList($options);

        $pager = array(
            'total' => $total,
            'query' => $this->query_filter
        );

        return $this->data_limit = $this->setPager($pager);
    }
939077
public function setPerPageList(array $perPageList)
    {
        $this->perPageList = $perPageList;

        if ($this->hasFilters(FALSE) || $this->hasOperation(FALSE)) {
            $this['form']['count']->setItems($this->getItemsForCountSelect());
        }

        return $this;
    }
512994
public function paging($paging = true, $append = true)
    {
        if ($paging === false && $append === false) {
            //TODO: exception
        }

        $this->paging = $paging;
        $this->append = $append;

        return $this;
    }
174387
public function paginate($perPage)
    {
        if (\filter_var($perPage, FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]) && ! \is_bool($perPage)) {
            $this->perPage = $perPage;
            $this->paginate = true;
        } elseif (\filter_var($perPage, FILTER_VALIDATE_BOOLEAN)) {
            $this->perPage = null;
            $this->paginate = $perPage;
        } else {
            $this->perPage = null;
            $this->paginate = false;
        }

        return $this;
    }