Paginated.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Helper\Select\Options; |
| 6 | |
| 7 | use AC\ArrayIterator; |
| 8 | use AC\Helper\Select; |
| 9 | |
| 10 | class Paginated extends Select\Options implements Select\Paginated |
| 11 | { |
| 12 | protected Select\Paginated $paginated; |
| 13 | |
| 14 | public function __construct(Select\Paginated $paginated, ArrayIterator $options) |
| 15 | { |
| 16 | $this->paginated = $paginated; |
| 17 | |
| 18 | parent::__construct($options->get_copy()); |
| 19 | } |
| 20 | |
| 21 | public function get_total_pages(): int |
| 22 | { |
| 23 | return $this->paginated->get_total_pages(); |
| 24 | } |
| 25 | |
| 26 | public function get_page(): int |
| 27 | { |
| 28 | return $this->paginated->get_page(); |
| 29 | } |
| 30 | |
| 31 | public function is_last_page(): bool |
| 32 | { |
| 33 | return $this->paginated->is_last_page(); |
| 34 | } |
| 35 | |
| 36 | } |
| 37 |