Counts the number of the needed page parameter given the classname or an object

See method resolvePage for details

@param string $pageclass
@return integer The number of needed page parameter.
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;
    }
560100
public function getImageCount($pageNumber)
    {


        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/pages/' . $pageNumber . '/images';

        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $json = json_decode($responseStream);

        return count($json->Images->List);
    }
613228
def count(self, model_class, conditions=None):
        '''
        
        '''
        query = 'SELECT count() FROM $table'
        if conditions:
            query += ' WHERE ' + conditions
        query = self._substitute(query, model_class)
        r = self._send(query)
        return int(r.text) if r.text else 0
699786
public function toRecord(string $recordClass): Record
    {
        $record = Record::instanceRecord($recordClass, $this->data);
        $record->setLoaded();
        return $record;
    }
98655
function getPageCount() {
		if (!$this->limit) {
			return 1;
		}
		$rem = ($this->getTotal() % $this->limit);
		$rem = ($rem >= 0) ? $rem : 0;
		$total_pages = ($this->getTotal() - $rem) / $this->limit;
		if ($rem)
			$total_pages++;
		return $total_pages;
	}
451249
private function getCurrentPage($pageParameter)
    {
        if (null === $this->requestStack->getCurrentRequest()) {
            return 1;
        }

        $page = $this->requestStack->getCurrentRequest()->get($pageParameter, 1);
        if ($page < 1 || $page > PHP_INT_MAX) {
            throw new PageOutOfBoundsException($page);
        }

        return $page;
    }
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;
    }
858693
protected function getPagesCount()
    {
        $query = $this->getQueryBuilder()->getQuery();
        $this->applyHints($query);
        $query->useResultCache($this->useCache, $this->cacheLifetime);

        $hasGroupBy = 0 < count($this->getQueryBuilder()->getDQLPart('groupBy'));

        $paginator = new DoctrinePaginator($query);
        // see https://github.com/doctrine/doctrine2/issues/4073
        $paginator->setUseOutputWalkers($hasGroupBy);
        $this->setRecordsCount($paginator->count());

        return ceil($this->getRecordsCount() / $this->getNumberOfElementsPerPage());
    }
1086789
public function getLimit(string $resourceClass = null, string $operationName = null, array $context = []): int
    {
        $graphql = $context['graphql'] ?? false;

        $limit = $this->options['items_per_page'];
        $clientLimit = $this->options['client_items_per_page'];

        if (null !== $resourceClass) {
            $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
            $limit = $resourceMetadata->getCollectionOperationAttribute($operationName, 'pagination_items_per_page', $limit, true);
            $clientLimit = $resourceMetadata->getCollectionOperationAttribute($operationName, 'pagination_client_items_per_page', $clientLimit, true);
        }

        if ($graphql && null !== ($first = $this->getParameterFromContext($context, 'first'))) {
            $limit = $first;
        }

        if ($graphql && null !== ($last = $this->getParameterFromContext($context, 'last'))) {
            $limit = $last;
        }

        if ($graphql && null !== ($before = $this->getParameterFromContext($context, 'before'))
            && (false === ($before = base64_decode($before, true)) ? 0 : (int) $before - $limit) < 0) {
            $limit = (int) $before;
        }

        if ($clientLimit) {
            $limit = (int) $this->getParameterFromContext($context, $this->options['items_per_page_parameter_name'], $limit);
            $maxItemsPerPage = $this->options['maximum_items_per_page'];

            if (null !== $resourceClass) {
                $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
                $maxItemsPerPage = $resourceMetadata->getCollectionOperationAttribute($operationName, 'maximum_items_per_page', $maxItemsPerPage, true);
            }

            if (null !== $maxItemsPerPage && $limit > $maxItemsPerPage) {
                $limit = $maxItemsPerPage;
            }
        }

        if (0 > $limit) {
            throw new InvalidArgumentException('Limit should not be less than 0');
        }

        return $limit;
    }
1075907
public static int getPageCount(int size, int pageSize, int page) {
        int totalPage = size / pageSize;
        if (size > pageSize * totalPage) {
            totalPage += 1;
        }
        return totalPage;
    }
160983
private function get_page_count()
    {
        if ($this->wp_query instanceof WP_User_Query) {
            if (empty($this->wp_query->get_results())) {
                return 0;
            }

            return \ceil($this->wp_query->get_total() / $this->wp_query->query_vars['number']);
        }

        return (int) $this->wp_query->max_num_pages;
    }
898882
public function resolve($class)
    {
        $result = false;
        $prefix = $class;

        while (false !== ($pos = strrpos($prefix, '\\'))) {
            $prefix = substr($class, 0, $pos + 1);

            if (isset($this->prefixes[$prefix])) {
                $result = $this->resolveFilename($prefix, str_replace('\\', '/', substr($class, $pos + 1)));

                if ($result !== false) {
                    break;
                }
            }

            $prefix = rtrim($prefix, '\\');
        }

        return $result;
    }
1324236
public static Url getPageUrl(final Class<? extends Page> pageClass,
		final PageParameters parameters)
	{
		final String url = RequestCycle.get().urlFor(pageClass, parameters).toString();
		return Url.parse(url);
	}
408811
public static function countHandlers($class, $name)
    {
        $class = ObjectHelper::getClass($class);
        $count = 0;

        do {
            if (!empty(self::$events[$class][$name])) {
                $count += count(static::$events[$class][$name]);
            }
        } while (($class = get_parent_class($class)) !== false);

        return $count;
    }
429000
public function countExercisePapers(Exercise $exercise)
    {
        return (int) $this->getEntityManager()
            ->createQuery('
                SELECT COUNT(p)
                FROM UJM\ExoBundle\Entity\Attempt\Paper AS p
                WHERE p.exercise = :exercise
            ')
            ->setParameters([
                'exercise' => $exercise,
            ])
            ->getSingleScalarResult();
    }
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;
    }
188064
public function pagerPageRange(PagerViewInterface $pager, $pageRange = null)
    {
        if (null === $pageRange) {
            $pageRange = $this->config->getPageRange();
        }

        $pageNumber = $pager->getCurrentPageNumber();
        $pageCount = $pager->getPageCount();

        if ($pageRange > $pageCount) {
            $pageRange = $pageCount;
        }

        $delta = ceil($pageRange / 2);

        if ($pageNumber - $delta > $pageCount - $pageRange) {
            $lowerBound = $pageCount - $pageRange + 1;
            $upperBound = $pageCount;
        } else {
            if ($pageNumber - $delta < 0) {
                $delta = $pageNumber;
            }

            $offset = $pageNumber - $delta;
            $lowerBound = $offset + 1;
            $upperBound = $offset + $pageRange;
        }

        $pages = array();
        for ($pageNumber = $lowerBound; $pageNumber <= $upperBound; ++$pageNumber) {
            $pages[$pageNumber] = $pageNumber;
        }

        return $pages;
    }