| 1 | <?php |
||
| 9 | class PaginationCriteria implements PaginationCriteriaInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var int|null |
||
| 13 | */ |
||
| 14 | private $page; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var int|null |
||
| 18 | */ |
||
| 19 | private $itemsPerPage; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param int $page |
||
| 23 | * @param int $itemsPerPage |
||
| 24 | */ |
||
| 25 | 21 | public function __construct( |
|
| 32 | |||
| 33 | /** |
||
| 34 | * @return int|null |
||
| 35 | */ |
||
| 36 | 6 | public function getPage() |
|
| 40 | |||
| 41 | /** |
||
| 42 | * @param int $page |
||
| 43 | */ |
||
| 44 | 21 | public function setPage(int $page = null) |
|
| 48 | |||
| 49 | /** |
||
| 50 | * @return int|null |
||
| 51 | */ |
||
| 52 | 7 | public function getItemsPerPage() |
|
| 56 | |||
| 57 | /** |
||
| 58 | * @param int $itemsPerPage |
||
| 59 | * |
||
| 60 | * @throws \BadMethodCallException |
||
| 61 | */ |
||
| 62 | 21 | public function setItemsPerPage(int $itemsPerPage = null) |
|
| 66 | |||
| 67 | /** |
||
| 68 | * {@inheritdoc} |
||
| 69 | */ |
||
| 70 | 12 | public function shouldBeApplied(): bool |
|
| 74 | |||
| 75 | /** |
||
| 76 | * @param int $number |
||
| 77 | * |
||
| 78 | * @return int |
||
| 79 | */ |
||
| 80 | 21 | private function convert(int $number = null): int |
|
| 84 | } |
||
| 85 |