Gets number of annotations on a specified document page.

@param integer $pageNumber Number of the page.

@return integer
@throws Exception
173842
public function getAnnotationsCount($pageNumber)
    {

        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/pages/' . $pageNumber . '/annotations';
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
        $json = json_decode($responseStream);
        return count($json->Annotations->List);
    }
1347641
private function evaluateAttributes(
        Request $request,
        CreatePaginator $annotation,
        DoctrinePaginator $paginator,
        int $limitPerPage,
        int $page
    ) {
        if ($annotation->getAttributes()) {
            $total = $paginator->count();
            $paginatorAttributes = new PaginatorAttributes(
                (int) ceil($total / $limitPerPage),
                $total,
                $page,
                $limitPerPage
            );

            $request->attributes->set(
                trim($annotation->getAttributes()),
                $paginatorAttributes
            );
        }
    }
846665
public function getPageCount() : int
    {
        if($this->lastResponse && $this->lastResponse->getHeaderLine('X-Total-Pages')) {
            return (int)$this->lastResponse->getHeaderLine('X-Total-Pages');
        }

        return 0;
    }
453000
public function count(): int
    {
        // If the count is already set, return it
        if(!is_null($this->count)) {
            return $this->count;
        }

        // Maually create a count by looping through the entities. This will
        // trigger the pagination calls to get the correct count of entities
        $count = 0;
        foreach($this as $entity) {
            $count++;
        }

        $this->count = $count;
        return $count;
    }
4854
public static function getPagesCount($linesNumber, $divider) {
        if ($linesNumber < 0 || $divider < 0) {
            return -1;
        }
        $pagesCount = intval($linesNumber / $divider);
        if (0 < ($linesNumber % $divider)) {
            ++$pagesCount;
        }
        return $pagesCount;
    }
448636
private function determinePageIdFromArguments()
    {
        if (empty($this->argumentNameOfPageId)) {
            return 0;
        }

        if (false === array_key_exists($this->argumentNameOfPageId, $this->restler->apiMethodInfo->arguments)) {
            return 0;
        }

        $index = $this->restler->apiMethodInfo->arguments[$this->argumentNameOfPageId];
        $pageId = (integer) $this->restler->apiMethodInfo->parameters[$index];
        return $pageId;
    }
1275841
public function setPageNumber($nPageNumber)
    {
        // Set the value of the Jaxon::PAGE_NUMBER parameter
        foreach($this->aParameters as $xParameter)
        {
            if($xParameter->getType() == Jaxon::PAGE_NUMBER)
            {
                $xParameter->setValue(intval($nPageNumber));
                break;
            }
        }
        return $this;
    }
59083
public function getNumberOfElements(): ?int
    {
        $this->checkRepository();

        return $this->_em->createQueryBuilder()
            ->select('count(a)')
            ->from($this->getEntityName(), 'a')
            ->getQuery()
            ->getSingleScalarResult()
        ;
    }
425173
public static function getParameterCount($pageclass) {
        if(is_object($pageclass)) {
            $pageclass = get_class($pageclass);
        }
        $count = array_count_values(explode("\\", $pageclass));
        return array_key_exists("_", $count) ? $count["_"] : 0;
    }
1166684
public function retrievePageElements($entityName, $page)
    {
        $page = $page < 1 ? 1 : $page;

        $qb = $this->createQueryBuilder($entityName);
        $qb
            ->setMaxResults($this->itemPerPage)
            ->setFirstResult(($page-1) * $this->itemPerPage)
        ;

        $paginator = new Paginator($qb, true);

        $this->page = $page;
        $this->count = $paginator->count();
        $this->results = $paginator->getIterator();
        $this->maxPage = ceil($this->count / $this->itemPerPage);

        return $this;
    }
594886
public function getPage(int $pageNumber)
    {
        $pages = $this->getPages();

        if (isset($pages[$pageNumber - 1])) {
            return $pages[$pageNumber - 1];
        }

        return null;
    }
54907
public function getIndirectObject($objectNumber)
    {
        $offset = $this->getOffsetFor($objectNumber);
        if ($offset === false) {
            throw new CrossReferenceException(
                \sprintf('Object (id:%s) not found.', $objectNumber),
                CrossReferenceException::OBJECT_NOT_FOUND
            );
        }

        $parser = $this->parser;

        $parser->getTokenizer()->clearStack();
        $parser->getStreamReader()->reset($offset + $this->fileHeaderOffset);

        try {
            /** @var PdfIndirectObject $object */
            $object = $parser->readValue(null, PdfIndirectObject::class);
        } catch (PdfTypeException $e) {
            throw new CrossReferenceException(
                \sprintf('Object (id:%s) not found at location (%s).', $objectNumber, $offset),
                CrossReferenceException::OBJECT_NOT_FOUND,
                $e
            );
        }

        if ($object->objectNumber !== $objectNumber) {
            throw new CrossReferenceException(
                \sprintf('Wrong object found, got %s while %s was expected.', $object->objectNumber, $objectNumber),
                CrossReferenceException::OBJECT_NOT_FOUND
            );
        }

        return $object;
    }
1043574
public function get_pagenum()
    {
        $pagenum = isset($_REQUEST['paged']) ? absint($_REQUEST['paged']) : 0;

        if (isset($this->pagination_args['total_pages']) && $pagenum > $this->pagination_args['total_pages']) {
            $pagenum = $this->pagination_args['total_pages'];
        }

        return max(1, $pagenum);
    }
791421
public function countMethodAnnotations()
    {
        $counter = 0;
        foreach ($this->methodAnnotations as $method) {
            if (count($method) == 0) {
                return 0;
            }
            foreach ($method as $annotationToken) {
                $counter = $counter + count($annotationToken);
            }
        }
        return $counter;
    }
1165003
def number_of_pages(self, key, value):
    """"""
    result = maybe_int(force_single_element(value.get('a', '')))
    if result and result > 0:
        return result
454048
protected function tryToGetJoinColumnNameOfMappedBy($annotation){
        $annotation = $this->tryToGetJoinColumnAnnotationOfMappedBy($annotation);
        if ($annotation !== null) {
            if ($annotation instanceof JoinColumn) {
                return $annotation->name;
            } else if ($annotation instanceof JoinColumns) {
                if (count($annotation->value) > 1) {
                    throw new \Exception('Multiple foreign key is not supported');
                }
                return $annotation->value[0]->name;
            }
        }
        return '';
    }
88202
public function getNumberOf(string $table, array $fields, array $values, string $connectionPhrase = "AND"): int
    {
        try {
            $this->db->beginTransaction();

            $query = "SELECT count(*) as numberOfEntities FROM $table ";

            $query = $query . $this->buildWhereCondition($fields, $connectionPhrase);

            /** @var PDOStatement $stmt */
            $stmt = $this->db->prepare($query);
            $stmt->execute($values);

            $this->db->commit();
            $result = $stmt->fetch();

            return $result['numberOfEntities'];
        } catch (PDOException $e) {
            $this->db->rollBack();
            throw new PDOException($e);
        }
    }