Makes a GET request to the API with parameters for page size,
page number, filtering and order values. Returns the API response.

@param int $pageNumber
@return mixed
11367
private function makeQuery($pageNumber = 1)
    {
        $params = array(
            'page_size' => $this->pageSize,
            'page' => $pageNumber
        );
        $params = array_merge($params, $this->filter);
        $params = array_merge($params, $this->order);
        $response = $this->api->get($this->typeClass->url(), $params);
        $this->countCached = $response->meta->total_count;

        return $response;
    }
1094044
public function showPosts($pagenumber = 1)
    {
        $posts = $this->post->findAll();

        $viewParamaters = array(
            'global' => $this->global,
            'posts' => $posts,
            'pageNumber' => $pagenumber
        );

        return \View::make($this->theme.'.posts', $viewParamaters);
    }
442938
public function getPage($pageNumber)
    {
        $response = $this->makeQuery($pageNumber);
        $className = $this->typeClass->objectClass;
        $objects = array();
        if (!isset($response->data) || !$response->data)
            return array();
        foreach ($response->data as $object) {
            $objects[] = new $className($this->api, $this->typeClass, $object);
        }

        return $objects;
    }
569986
public function gets($params, &$pager=null)
	{
		if (empty($params))
		{
			throw new \Exception("no params.");
		}

		$selectdb = new SelectDB($this->db);
		$selectdb->from($this->table);
		$selectdb->primary = $this->primary;
		$selectdb->select($this->select);

		if (!isset($params['order']))
		{
			$params['order'] = "`{$this->table}`.{$this->primary} desc";
		}
		$selectdb->put($params);

		if (isset($params['page']))
		{
			$selectdb->paging();
			$pager = $selectdb->pager;
		}

		return $selectdb->getall();
	}
709926
protected static function restGetPage($default = 1)
    {
        $page = Request::getInstance()->query('_page', $default);
        if (!is_numeric($page) || $page < 1) {
            return $default;
        }

        return (int)$page;
    }
887568
protected function getMinPage()
    {
        $minPageNumber = null;
        $minPage       = null;
        foreach ($this->pages as $page) {
            $pageNumber = $page->getPageNumber();
            if ($minPageNumber === null || $pageNumber < $minPageNumber) {
                $minPageNumber = $pageNumber;
                $minPage       = $page;
            }
        }
        return $minPage;
    }
1088238
public function getPagedResults($limit = 50, $page = 0)
    {
        $dql = sprintf(self::DQL_GET_PAGED, AuditEvent::class);
        return $this->getPaginator($dql, $limit, $page);
    }
1069630
public function getSinglePageResourceUri( $pagenum = null, $pagesize=null)
    {
        if( is_null($pagenum) ) $pagenum  =$this->pagenum;
        if( is_null($pagesize)) $pagesize =$this->pagesize;
        
        //rebuild query string from already parsed _GET superglobal but do not override it.
        $vars = $_GET;
        $o=$this->ns(self::LOCAL);
        $vars[$o->getValue('plabel')]   = $pagenum;
        $vars[$o->getValue('pslabel')]  = $pagesize;
        
        return $this->getQueryStrippedUri() . '?'. http_build_query($vars);
    }
244734
public function getArticles($articleNumber = null)
    {
        $requestData = new Get\RequestData();
        $requestData->setArticleNumber($articleNumber);

        $request = new Get\Request($requestData);

        return $this->sendRequest($request, Get\ApiResponse::class);
    }
1208645
public function getPage($pageNumber)
    {
        if (!\is_numeric($pageNumber)) {
            throw new \InvalidArgumentException(
                'Page number needs to be a number.'
            );
        }

        if ($pageNumber < 1 || $pageNumber > $this->getPageCount()) {
            throw new \InvalidArgumentException(
                \sprintf(
                    'Page number "%s" out of available page range (1 - %s)',
                    $pageNumber,
                    $this->getPageCount()
                )
            );
        }

        $this->readPages();

        $page = $this->pages[$pageNumber - 1];

        if ($page instanceof PdfIndirectObjectReference) {
            $readPages = function ($kids) use (&$readPages) {
                $kids = PdfArray::ensure($kids);

                /** @noinspection LoopWhichDoesNotLoopInspection */
                foreach ($kids->value as $reference) {
                    $reference = PdfIndirectObjectReference::ensure($reference);
                    $object = $this->parser->getIndirectObject($reference->value);
                    $type = PdfDictionary::get($object->value, 'Type');

                    if ($type->value === 'Pages') {
                        return $readPages(PdfDictionary::get($object->value, 'Kids'));
                    }

                    return $object;
                }

                throw new PdfReaderException(
                    'Kids array cannot be empty.',
                    PdfReaderException::KIDS_EMPTY
                );
            };

            $page = $this->parser->getIndirectObject($page->value);
            $dict = PdfType::resolve($page, $this->parser);
            $type = PdfDictionary::get($dict, 'Type');
            if ($type->value === 'Pages') {
                $kids = PdfType::resolve(PdfDictionary::get($dict, 'Kids'), $this->parser);
                $page = $this->pages[$pageNumber - 1] = $readPages($kids);
            } else {
                $this->pages[$pageNumber - 1] = $page;
            }
        }

        return new Page($page, $this->parser);
    }
760382
public function document($documentNumber)
    {
        $data = $this->execute(
            self::HTTP_GET,
            self::DOMUSERP_API_PEDIDOVENDA . '/pessoas/documento',
            ['query' => ['num' => $documentNumber]]
        );

        return $data;
    }
10647
public function getCurrentPageNumber()
    {
        $request = $this->getRequest();

        $optionsRenderer = $this->getOptionsRenderer();
        $parameterNames = $optionsRenderer['parameterNames'];
        if ($request->getParam($parameterNames['currentPage']) != '') {
            return (int) $request->getParam($parameterNames['currentPage']);
        }

        return (int) 1;
    }
1310564
public function get($url, $parameters = [])
    {
        $httpClient = $this->client->getHttpClient();

        if (!empty($this->pager)) {
            $parameters['page'] = $this->pager->getPage();
            $parameters['perPage'] = $this->pager->getResultsPerPage();
        }

        $response = $httpClient->get($url, ['query' => $parameters]);

        return $httpClient->parseResponse($response);
    }
1361486
public function getPaginated($paged = 15, $orderBy = 'created_at', $sort = 'desc')
    {
        $query = function () use ($paged, $orderBy, $sort) {

            return $this->model
                ->with($this->requiredRelationships)
                ->orderBy($orderBy, $sort)
                ->paginate($paged);
        };

        return $this->doQuery($query);
    }
542073
public function getCurrentPageNumber()
    {
        $optionsRenderer = $this->getOptionsRenderer();
        $parameterNames = $optionsRenderer['parameterNames'];

        $request = $this->getRequest();
        if ($request instanceof HttpRequest) {
            $this->currentPageNumber = (int) $request->getPost(
                $parameterNames['currentPage'],
                $request->getQuery($parameterNames['currentPage'], 1)
            );
        }

        return (int) $this->currentPageNumber;
    }
751609
public function getImportedExternalPageLinks($pageNumber)
	{
		$links = [];

		$reader = $this->getPdfReader($this->currentReaderId);
		$parser = $reader->getParser();

		$page = $reader->getPage($pageNumber);
		$page->getPageDictionary();

		$annotations = $page->getAttribute('Annots');
		if ($annotations instanceof PdfIndirectObjectReference) {
			$annotations = PdfType::resolve($parser->getIndirectObject($annotations->value), $parser);
		}

		if ($annotations instanceof PdfArray) {

			$getAttribute = function ($array, $key) {
				if (isset($array[$key]->value)) {
					return $array[$key]->value;
				}

				return '';
			};

			foreach ($annotations->value as $annotation) {
				$annotation = PdfType::resolve($annotation, $parser)->value;

				/* Skip over any annotations that aren't links */
				$type = $getAttribute($annotation, 'Type');
				$subtype = $getAttribute($annotation, 'Subtype');
				if ($type !== 'Annot' || $subtype !== 'Link' || !isset($annotation['A'])) {
					continue;
				}

				/* Calculate the link positioning */
				$position = $getAttribute($annotation, 'Rect');

				if (count($position) !== 4) {
					continue;
				}

				$x1 = $getAttribute($position, 0) / Mpdf::SCALE;
				$y1 = $getAttribute($position, 1) / Mpdf::SCALE;
				$x2 = $getAttribute($position, 2) / Mpdf::SCALE;
				$y2 = $getAttribute($position, 3) / Mpdf::SCALE;
				$width = $x2 - $x1;
				$height = $y2 - $y1;

				$link = $annotation['A'] instanceof PdfIndirectObjectReference ? PdfType::resolve($annotation['A'], $parser)->value : $getAttribute($annotation, 'A');

				if (isset($link['URI'])) {
					$links[] = [
						'x' => $x1,
						'y' => $y1,
						'width' => $width,
						'height' => $height,
						'url' => $getAttribute($link, 'URI')
					];
				}
			}
		}

		return $links;
	}
426479
public function fetchPage($pageName)
    {
        $pageName = (string) $pageName;

        if (!array_key_exists($pageName, $this->pages))
        {
            if ('' == $pageName)
            {
                $page = ContentPageQuery::create()
                    ->filterByIsPublished(true)
                    ->filterByName(null, Criteria::ISNULL)
                    ->_or()
                    ->filterByName('')
                    ->findOne()
                ;
            }
            else
            {
                $page = ContentPageQuery::create()
                    ->filterByIsPublished(true)
                    ->filterByName($pageName)
                    ->findOne()
                ;
            }

            $this->pages[$pageName] = $page;
        }

        return $this->pages[$pageName];
    }