1 | <?php |
||
19 | trait FeaturesSupport |
||
20 | { |
||
21 | use AttributeExists; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | private $args = []; |
||
27 | |||
28 | /** |
||
29 | * @var array|\Closure[] |
||
30 | */ |
||
31 | private $fieldsWrapper = []; |
||
32 | |||
33 | /** |
||
34 | * @var array|\Closure[] |
||
35 | */ |
||
36 | private $queries = []; |
||
37 | |||
38 | /** |
||
39 | * @param string $name |
||
40 | * @param Type $type |
||
41 | * @param string|null $description |
||
42 | * @return $this |
||
43 | */ |
||
44 | public function addArgument(string $name, Type $type, string $description = null) |
||
53 | |||
54 | /** |
||
55 | * @param \Closure $wrapper |
||
56 | * @return $this |
||
57 | */ |
||
58 | public function addFieldsWrapper(\Closure $wrapper) |
||
64 | |||
65 | /** |
||
66 | * @param \Closure $resolveQuery |
||
67 | * @return $this |
||
68 | */ |
||
69 | public function addQuery(\Closure $resolveQuery) |
||
75 | |||
76 | /** |
||
77 | * @param string $argument |
||
78 | * @param \Closure $resolveQuery |
||
79 | * @return $this |
||
80 | */ |
||
81 | public function addQueryFor(string $argument, \Closure $resolveQuery) |
||
91 | |||
92 | /** |
||
93 | * @return void |
||
94 | */ |
||
95 | protected function boot(): void |
||
99 | |||
100 | /** |
||
101 | * @return void |
||
102 | */ |
||
103 | protected function bootTraits(): void |
||
111 | |||
112 | /** |
||
113 | * @param array $arguments |
||
114 | * @return array |
||
115 | */ |
||
116 | protected function extendArguments(array $arguments = []): array |
||
120 | |||
121 | /** |
||
122 | * @param array $fields |
||
123 | * @return array |
||
124 | */ |
||
125 | protected function extendFields(array $fields = []): array |
||
137 | |||
138 | /** |
||
139 | * @param Builder $builder |
||
140 | * @param array $args |
||
141 | * @return Builder|mixed |
||
142 | */ |
||
143 | protected function extendQuery(Builder $builder, array $args) |
||
151 | } |