Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
58 | public function data(): ModelCollection |
||
59 | { |
||
60 | $result = $this->model |
||
61 | ->limit($this->perPage) |
||
62 | ->offset($this->perPage * ($this->page - 1)) |
||
63 | ->get(); |
||
64 | |||
65 | $models = array_map(function ($item) { |
||
66 | return wrapToModel($item->getOrmInstance(), $this->modelClass); |
||
67 | }, iterator_to_array($result)); |
||
68 | |||
69 | return new ModelCollection($models); |
||
70 | } |
||
99 | } |