| 1 | <?php |
||
| 5 | class ArrayDataProvider implements DataProviderInterface |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var array |
||
| 9 | */ |
||
| 10 | private $data; |
||
| 11 | |||
| 12 | public function __construct(array $data) |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Should return total amount of rows |
||
| 19 | * @return int |
||
| 20 | */ |
||
| 21 | public function getCount() : int |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Should return amount of pages |
||
| 28 | * @param int $perPage - amount of records per page |
||
| 29 | * @return int |
||
| 30 | */ |
||
| 31 | public function getTotalPages(int $perPage) : int |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Should return a list of data for current page |
||
| 38 | * @param int $page |
||
| 39 | * @param int $perPage - amount of records per page |
||
| 40 | * @return mixed |
||
| 41 | */ |
||
| 42 | public function getData(int $page, int $perPage) |
||
| 46 | } |