Sets pager
@return array
519767
protected function setPagerListTrigger()
    {
        $conditions = $this->query_filter;
        $conditions['count'] = true;

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

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

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

        return $this->data_limit = $this->setPager($pager);
    }
781649
public function pager(ODataQueryPager $pager = NULL) {
        if (isset($pager)) {
            $this->setPager($pager);
            return $this;
        }
        return $this->getPager();
    }
393663
public function set(): PageInterface
    {
        $hook = $this->isNetwork() ? 'network_admin_menu' : 'admin_menu';

        // Action for page display.
        $this->action->add($hook, [$this, 'build']);
        // Action for page settings.
        $this->action->add('admin_init', [$this, 'configureSettings']);

        return $this;
    }
1303734
public function setPage($page)
    {
        $this->page = null === $page ? null : (int)$page;
        $this->updateOffset();
        return $this;
    }
296051
public function pager() {
        global $OUTPUT;

        if (!$this->supports_paging()) {
            return '';
        }

        return $OUTPUT->paging_bar(
            count($this->items), $this->page, $this->perpage,
            new moodle_url('/grade/report/singleview/index.php', array(
                'perpage' => $this->perpage,
                'id' => $this->courseid,
                'group' => $this->groupid,
                'itemid' => $this->itemid,
                'item' => 'user'
            ))
        );
    }
576199
public function pager() {
        global $OUTPUT;

        return $OUTPUT->paging_bar(
            $this->totalitemcount, $this->page, $this->perpage,
            new moodle_url('/grade/report/singleview/index.php', array(
                'perpage' => $this->perpage,
                'id' => $this->courseid,
                'group' => $this->groupid,
                'itemid' => $this->itemid,
                'item' => 'grade'
            ))
        );
    }
857480
protected function setPagerListBackup()
    {
        $options = $this->query_filter;
        $options['count'] = true;

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

        return $this->data_limit = $this->setPager($pager);
    }
13984
protected function setDataRelatedIndexProduct()
    {
        $products = $this->getRelatedProduct();

        if (!empty($products)) {

            $pager_options = array(
                'key' => 'rlp',
                'total' => count($products),
                'limit' => $this->config('related_pager_limit', 4)
            );

            $pager = $this->getPager($pager_options);

            if (!empty($pager['limit'])) {
                list($from, $to) = $pager['limit'];
                $products = array_slice($products, $from, $to);
            }

            $data = array(
                'products' => $products,
                'pager' => $pager['rendered']
            );

            $this->setData('related', $this->render('product/related', $data));
        }
    }
726838
public function PaginatedList()
    {
        $all_posts = $this->blogPosts ?: ArrayList::create();

        $posts = PaginatedList::create($all_posts);

        $posts->setPageLength($this->PostsPerPage);

        // Set current page
        $start = $this->request->getVar($posts->getPaginationGetVar());
        $posts->setPageStart($start);

        return $posts;
    }
1219672
public function renderPager()
	{
		if (!$this->json) {
			parent::renderPager();
			return true;
		}

		$pager = array();
		if (is_string($this->pager)) {
			$class = $this->pager;
		} else if (is_array($this->pager)) {
			$pager = $this->pager;
			if (isset($pager['class'])) {
				$class = $pager['class'];
				unset($pager['class']);
			}
		}
		$pager['pages'] = $this->dataProvider->getPagination();

		if ($pager['pages']->getPageCount() > 1) {
			$pager['json'] = $this->json;
			$widget = $this->createWidget($class, $pager);

			return $widget->run();
		} else {
			return array();
		}
	}
909001
protected function setPagerlListAddress()
    {
        $conditions = $this->query_filter;
        $conditions['count'] = true;

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

        return $this->data_limit = $this->setPager($pager);
    }
682501
protected function setPagerListCollectionItem()
    {
        $options = $this->query_filter;
        $options['count'] = true;
        $options['collection_id'] = $this->data_collection['collection_id'];

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

        return $this->data_limit = $this->setPager($pager);
    }
1049363
public function decodeHttpQuery()
    {
        $values = [];

        foreach ($this->getRequest()->query->all() as $key => $parameter) {
            if (strpos($key, self::PAGE) === 0) {
                $chunks = explode('_', $key);
                $contextId = end($chunks);
                $pager = new Pager($this);
                $pager->setFor($contextId)->setCurrent($parameter);
                $values[$key] = $pager;
            }
        }

        return $values;
    }
1053216
public function setPagination()
    {

        $total = $this->getListTotal();

        if (empty($total))
            return null;

        //Get the current page state from the request;
        $limit = $this->getListLimit();
        $current = $this->getState("currentpage", 1);
        $pages = array();

        //@TODO: Calculates the pages from a recordset or an array of results
        $pages['total'] = ceil($total / $limit);
        $pages['limit'] = $limit;

        //Get the real path to the current page
        $route = $this->container->router->getMatchedRoute();


        $pages['current'] = $route->getURLfromPathWithValues(["page" => strval($current)]);
        //Previous page link
        if (intval($current - 1) > 0):
            $pages['previous'] = $route->getURLfromPathWithValues(["page" => strval($current - 1)] );
        endif;
        //Next page link
        if (intval($current + 1) <= $pages['total']):
            $pages['next'] = $route->getURLfromPathWithValues(["page" => strval($current + 1)] );
        endif;

        //Build the pages;
        for ($i = 0; $i < $pages['total']; $i++):
            $page = $i + 1;
            $pages['pages'][] = array(
                "page_title" => strval($page),
                "page_link" => $route->getURLfromPathWithValues(["page" => $page] ),
                "page_state" => ($page == $current) ? "active" : null,
            );
        endfor;

        //Sets the pagination output;
        if (sizeof($pages['pages']) > 1)
            $this->pagination = $pages;

    }
275319
protected function setPagerlListBookmark()
    {
        $options = $this->query_filter;
        $options['count'] = true;
        $total = (int) $this->bookmark->getList($options);

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

        return $this->data_limit = $this->setPager($pager);
    }
17744
protected function setHeaders()
    {
        \pwf\basic\Application::$instance
            ->getResponse()
            ->setHeaders([
                'x-pagination-current-page: '.$this->getPage(),
                'x-pagination-page-count: '.$this->getPageQty(),
                'x-pagination-per-page: '.max($this->getLimit(), 1),
                'x-pagination-total-count: '.$this->count()
        ]);
        return $this;
    }