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