123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- namespace Cube\Paginator\Adapter;
- class ArrayAdapter implements AdapterInterface
- {
-
- protected $_data = null;
-
- protected $_count = null;
-
- public function __construct(array $data)
- {
- $this->_data = $data;
- $this->_count = count($this->_data);
- }
-
- public function getItems($offset, $itemCountPerPage)
- {
- return array_slice($this->_data, $offset, $itemCountPerPage);
- }
-
- public function count()
- {
- return $this->_count;
- }
- }
|