vendor/knplabs/knp-components/src/Knp/Component/Pager/PaginatorInterface.php line 48

Open in your IDE?
  1. <?php
  2. namespace Knp\Component\Pager;
  3. use Knp\Component\Pager\Pagination\PaginationInterface;
  4. /**
  5.  * PaginatorInterface
  6.  */
  7. interface PaginatorInterface
  8. {
  9.     public const DEFAULT_SORT_FIELD_NAME 'defaultSortFieldName';
  10.     public const DEFAULT_SORT_DIRECTION 'defaultSortDirection';
  11.     public const DEFAULT_FILTER_FIELDS 'defaultFilterFields';
  12.     public const SORT_FIELD_PARAMETER_NAME 'sortFieldParameterName';
  13.     public const SORT_FIELD_ALLOW_LIST 'sortFieldAllowList';
  14.     public const SORT_DIRECTION_PARAMETER_NAME 'sortDirectionParameterName';
  15.     public const PAGE_PARAMETER_NAME 'pageParameterName';
  16.     public const FILTER_FIELD_PARAMETER_NAME 'filterFieldParameterName';
  17.     public const FILTER_VALUE_PARAMETER_NAME 'filterValueParameterName';
  18.     public const FILTER_FIELD_ALLOW_LIST 'filterFieldAllowList';
  19.     public const DISTINCT 'distinct';
  20.     public const PAGE_OUT_OF_RANGE 'pageOutOfRange';
  21.     public const DEFAULT_LIMIT 'defaultLimit';
  22.     public const ODM_QUERY_OPTIONS 'odmQueryOptions';
  23.     public const PAGE_OUT_OF_RANGE_IGNORE 'ignore'// do nothing (default)
  24.     public const PAGE_OUT_OF_RANGE_FIX 'fix'// replace page number out of range with max page
  25.     public const PAGE_OUT_OF_RANGE_THROW_EXCEPTION 'throwException'// throw PageNumberOutOfRangeException
  26.     public const DEFAULT_LIMIT_VALUE 10;
  27.     /**
  28.      * Paginates anything (depending on event listeners)
  29.      * into Pagination object, which is a view targeted
  30.      * pagination object (might be aggregated helper object)
  31.      * responsible for the pagination result representation
  32.      *
  33.      * @param mixed                 $target  anything what needs to be paginated
  34.      * @param int                   $page    page number, starting from 1
  35.      * @param int|null              $limit   number of items per page
  36.      * @param array<string, mixed>  $options less used options:
  37.      *                                       bool   $distinct           default true for distinction of results
  38.      *                                       string $alias              pagination alias, default none
  39.      *                                       array  $sortFieldAllowList sortable allow list for target fields being paginated
  40.      *
  41.      * @return PaginationInterface<int, mixed>
  42.      */
  43.     public function paginate(mixed $targetint $page 1int $limit null, array $options = []): PaginationInterface;
  44. }