Skip to content
Snippets Groups Projects
Select Git revision
  • a87e955869b036be961bd733bdea17c085820118
  • main default protected
  • demo protected
  • master
  • icon-set-mapping
  • production protected
  • revert-62666d1a
  • favorites-and-recent-files
  • lit2
  • wc-part
  • mark-downloaded-files
  • feature/annotpdf-test
  • fix-zip-upload
  • config-cleanup
  • wip
  • app-shell-update
16 results

vpu-qualified-signature-pdf-upload.js

Blame
  • Pagination.php 925 B
    <?php
    
    declare(strict_types=1);
    
    namespace Dbp\Relay\CoreBundle\Pagination;
    
    class Pagination
    {
        private const CURRENT_PAGE_NUMBER_DEFAULT = 1;
        public const MAX_NUM_ITEMS_PER_PAGE_DEFAULT = 30;
    
        private const CURRENT_PAGE_NUMBER_PARAMETER_NAME = 'page';
        private const MAX_NUM_ITEMS_PER_PAGE_PARAMETER_NAME = 'perPage';
    
        public static function getCurrentPageNumber(array $options): int
        {
            return max(1, intval($options[self::CURRENT_PAGE_NUMBER_PARAMETER_NAME] ?? self::CURRENT_PAGE_NUMBER_DEFAULT));
        }
    
        public static function getMaxNumItemsPerPage(array $options): int
        {
            return max(1, intval($options[self::MAX_NUM_ITEMS_PER_PAGE_PARAMETER_NAME] ?? self::MAX_NUM_ITEMS_PER_PAGE_DEFAULT));
        }
    
        public static function getFirstItemIndex(int $currentPageNumber, int $maxNumItemsPerPage)
        {
            return max(0, ($currentPageNumber - 1) * $maxNumItemsPerPage);
        }
    }