| 1 | <?php |
||
| 8 | class PaginationResult implements \IteratorAggregate, \Countable |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var mixed |
||
| 12 | */ |
||
| 13 | public $records; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var null|bool |
||
| 17 | */ |
||
| 18 | public $hasPrevious; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var null|mixed |
||
| 22 | */ |
||
| 23 | public $previousCursor; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var null|bool |
||
| 27 | */ |
||
| 28 | public $hasNext; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var null|mixed |
||
| 32 | */ |
||
| 33 | public $nextCursor; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @var null|mixed |
||
| 37 | */ |
||
| 38 | public $previousUrl; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @var null|mixed |
||
| 42 | */ |
||
| 43 | public $nextUrl; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @var null|mixed |
||
| 47 | */ |
||
| 48 | public $tab; |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @var null|mixed |
||
| 52 | */ |
||
| 53 | public $query = []; |
||
| 54 | |||
| 55 | /** |
||
| 56 | * PaginationResult constructor. |
||
| 57 | * Merge $meta entries into $this. |
||
| 58 | * |
||
| 59 | * @param mixed $rows |
||
| 60 | * @param array $meta |
||
| 61 | */ |
||
| 62 | public function __construct($rows, array $meta) |
||
| 69 | |||
| 70 | /** |
||
| 71 | * Get iterator of records. |
||
| 72 | * |
||
| 73 | * @return \ArrayIterator|\Traversable |
||
| 74 | */ |
||
| 75 | public function getIterator() |
||
| 79 | |||
| 80 | /** |
||
| 81 | * Count records. |
||
| 82 | * |
||
| 83 | * @return int |
||
| 84 | * @see https://wiki.php.net/rfc/counting_non_countables |
||
| 85 | */ |
||
| 86 | public function count() |
||
| 90 | |||
| 91 | /** |
||
| 92 | * Render the paginator using the given view. |
||
| 93 | * |
||
| 94 | * @param string|null $view |
||
| 95 | * @param array $data |
||
| 96 | * @return \Illuminate\Contracts\Support\Htmlable |
||
| 97 | */ |
||
| 98 | public function render($view = 'rapid-pagination::default', $data = []) |
||
| 104 | } |
||
| 105 |