Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2declare(strict_types=1);
3/**
4 * Pop PHP Framework (https://www.popphp.org/)
5 *
6 * @link       https://github.com/popphp/popphp-framework
7 * @author     Nick Sagona, III <dev@noladev.com>
8 * @copyright  Copyright (c) 2009-2027 NOLA Interactive, LLC.
9 * @license    https://www.popphp.org/license     New BSD License
10 */
11
12/**
13 * @namespace
14 */
15namespace Pop\Paginator;
16
17/**
18 * Paginator interface
19 *
20 * @category   Pop
21 * @package    Pop\Paginator
22 * @author     Nick Sagona, III <dev@noladev.com>
23 * @copyright  Copyright (c) 2009-2027 NOLA Interactive, LLC.
24 * @license    https://www.popphp.org/license     New BSD License
25 * @version    4.1.0
26 */
27interface PaginatorInterface
28{
29
30    /**
31     * Set the query key
32     *
33     * @param  string $key
34     * @return PaginatorInterface
35     */
36    public function setQueryKey(string $key): PaginatorInterface;
37
38    /**
39     * Set the bookends
40     *
41     * @param  array $bookends
42     * @return PaginatorInterface
43     */
44    public function setBookends(array $bookends): PaginatorInterface;
45
46    /**
47     * Get the content items total
48     *
49     * @return int
50     */
51    public function getTotal(): int;
52
53    /**
54     * Get the per page
55     *
56     * @return int
57     */
58    public function getPerPage(): int;
59
60    /**
61     * Get the page range
62     *
63     * @return int
64     */
65    public function getRange(): int;
66
67    /**
68     * Get the query key
69     *
70     * @return string
71     */
72    public function getQueryKey(): string;
73
74    /**
75     * Get the current page
76     *
77     * @return int
78     */
79    public function getCurrentPage(): int;
80
81    /**
82     * Get the number of pages
83     *
84     * @return int
85     */
86    public function getNumberOfPages(): int;
87
88    /**
89     * Get a bookend
90     *
91     * @param  string $key
92     * @return string|null
93     */
94    public function getBookend(string $key): string|null;
95
96    /**
97     * Get the bookends
98     *
99     * @return array
100     */
101    public function getBookends(): array;
102
103    /**
104     * Calculate the page range
105     *
106     * @param  int $page
107     * @return array
108     */
109    public function calculateRange(int $page = 1): array;
110
111}