1 | <?php |
||
11 | abstract class QueryBuilderAbstract |
||
12 | { |
||
13 | /** @var Request $request */ |
||
14 | protected $request; |
||
15 | |||
16 | /** @var Builder $query */ |
||
17 | protected $query; |
||
18 | |||
19 | /** @var Fields $fields */ |
||
20 | protected $fields; |
||
21 | |||
22 | /** @var QueryParamBag $includes */ |
||
23 | protected $includes; |
||
24 | |||
25 | /** @var QueryParamBag $filters */ |
||
26 | protected $filters; |
||
27 | |||
28 | /** @var QueryHelper $queryHelper */ |
||
29 | private $queryHelper; |
||
30 | |||
31 | public function __construct(Request $request) |
||
40 | |||
41 | abstract protected function init(): Builder; |
||
42 | |||
43 | protected function fields() |
||
47 | |||
48 | protected function filter(QueryParamBag $filters) |
||
52 | |||
53 | protected function include(QueryParamBag $includes) |
||
57 | |||
58 | protected function sort(): array |
||
62 | |||
63 | public function exact($fields): QueryHelper |
||
67 | |||
68 | public function alias(string $name, $value): QueryHelper |
||
72 | |||
73 | public function fetch() |
||
95 | |||
96 | private function appendSortQuery(): void |
||
106 | |||
107 | private function appendParamsToPaginatedUrl(): LengthAwarePaginator |
||
121 | |||
122 | public function fetchFirst() |
||
126 | } |
||
127 |