| 1 | <?php |
||
| 12 | class Pagination |
||
| 13 | { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Specify further pages. |
||
| 17 | * |
||
| 18 | * @var int|null |
||
| 19 | */ |
||
| 20 | protected $page = null; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Set a custom page size up to 100. |
||
| 24 | * |
||
| 25 | * @var int|null |
||
| 26 | */ |
||
| 27 | protected $limit = null; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Pagination constructor. |
||
| 31 | * |
||
| 32 | * @param int|null $page |
||
| 33 | * @param int|null $limit |
||
| 34 | */ |
||
| 35 | public function __construct(int $page = null, int $limit = null) |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Get page |
||
| 43 | * |
||
| 44 | * @return int|null |
||
| 45 | */ |
||
| 46 | public function getPage() |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Set page |
||
| 53 | * |
||
| 54 | * @param int|null $page |
||
| 55 | * |
||
| 56 | * @return Pagination |
||
| 57 | */ |
||
| 58 | public function setPage($page): Pagination |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Get limit |
||
| 67 | * |
||
| 68 | * @return int|null |
||
| 69 | */ |
||
| 70 | public function getLimit() |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Set limit |
||
| 77 | * |
||
| 78 | * @param int|null $limit |
||
| 79 | * |
||
| 80 | * @return Pagination |
||
| 81 | */ |
||
| 82 | public function setLimit($limit): Pagination |
||
| 88 | } |