Total Complexity | 7 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
8 | class ORMDataSource implements DataSourceInterface |
||
9 | { |
||
10 | private QueryBuilder $data; |
||
11 | private bool $pagination; |
||
12 | private int $page; |
||
13 | private int $maxPerPage; |
||
14 | private array $orderBy; |
||
15 | private array $filters; |
||
16 | |||
17 | public function __construct( |
||
18 | QueryBuilder $data, |
||
19 | bool $pagination, |
||
20 | int $page = 1, |
||
21 | int $maxPerPage = 25, |
||
22 | array $orderBy = [], |
||
23 | array $filters = [] |
||
24 | ) { |
||
25 | $this->data = $data; |
||
26 | $this->pagination = $pagination; |
||
27 | $this->page = $page; |
||
28 | $this->maxPerPage = $maxPerPage; |
||
29 | $this->orderBy = $orderBy; |
||
30 | $this->filters = $filters; |
||
31 | } |
||
32 | |||
33 | public function getData(): QueryBuilder |
||
34 | { |
||
35 | return $this->data; |
||
36 | } |
||
37 | |||
38 | public function isPaginated(): bool |
||
39 | { |
||
40 | return $this->pagination; |
||
41 | } |
||
42 | |||
43 | public function getPage(): int |
||
44 | { |
||
45 | return $this->page; |
||
46 | } |
||
47 | |||
48 | public function getMaxPerPage(): int |
||
49 | { |
||
50 | return $this->maxPerPage; |
||
51 | } |
||
52 | |||
53 | public function getOrderBy(): array |
||
54 | { |
||
55 | return $this->orderBy; |
||
56 | } |
||
57 | |||
58 | public function getFilters(): array |
||
61 | } |
||
62 | } |
||
63 |