|
26 | 26 | */ |
27 | 27 | final class OAuth2GroupApiController extends OAuth2ProtectedController |
28 | 28 | { |
29 | | - use GetAllTrait { |
30 | | - GetAllTrait::getAll as traitGetAll; |
31 | | - } |
32 | | - |
33 | | - /** |
34 | | - * OAuth2UserApiController constructor. |
35 | | - * @param IGroupRepository $repository |
36 | | - * @param IResourceServerContext $resource_server_context |
37 | | - * @param ILogService $log_service |
38 | | - */ |
39 | | - public function __construct |
40 | | - ( |
41 | | - IGroupRepository $repository, |
42 | | - IResourceServerContext $resource_server_context, |
43 | | - ILogService $log_service, |
44 | | - ) |
45 | | - { |
46 | | - parent::__construct($resource_server_context, $log_service); |
47 | | - $this->repository = $repository; |
48 | | - } |
49 | | - |
50 | | - protected function getAllSerializerType(): string |
51 | | - { |
52 | | - return SerializerRegistry::SerializerType_Public; |
53 | | - } |
54 | | - |
55 | | - /** |
56 | | - * @return array |
57 | | - */ |
58 | | - protected function getFilterRules(): array |
59 | | - { |
60 | | - return [ |
61 | | - 'slug' => ['=='], |
62 | | - ]; |
63 | | - } |
64 | | - |
65 | | - /** |
66 | | - * @return array |
67 | | - */ |
68 | | - protected function getFilterValidatorRules(): array |
69 | | - { |
70 | | - return [ |
71 | | - 'slug' => 'sometimes|required|string', |
72 | | - ]; |
73 | | - } |
74 | | - |
75 | | - public function getOrderRules(): array |
76 | | - { |
77 | | - return [ |
78 | | - 'id', |
79 | | - 'name', |
80 | | - 'slug' |
81 | | - ]; |
82 | | - } |
| 29 | + use GetAllTrait; |
83 | 30 |
|
84 | 31 | #[OA\Get( |
85 | 32 | path: '/api/v1/groups', |
@@ -166,8 +113,56 @@ public function getOrderRules(): array |
166 | 113 | ) |
167 | 114 | ] |
168 | 115 | )] |
169 | | - public function getAll() |
| 116 | + |
| 117 | + /** |
| 118 | + * OAuth2UserApiController constructor. |
| 119 | + * @param IGroupRepository $repository |
| 120 | + * @param IResourceServerContext $resource_server_context |
| 121 | + * @param ILogService $log_service |
| 122 | + */ |
| 123 | + public function __construct |
| 124 | + ( |
| 125 | + IGroupRepository $repository, |
| 126 | + IResourceServerContext $resource_server_context, |
| 127 | + ILogService $log_service, |
| 128 | + ) |
170 | 129 | { |
171 | | - return $this->traitGetAll(); |
| 130 | + parent::__construct($resource_server_context, $log_service); |
| 131 | + $this->repository = $repository; |
172 | 132 | } |
| 133 | + |
| 134 | + protected function getAllSerializerType(): string |
| 135 | + { |
| 136 | + return SerializerRegistry::SerializerType_Public; |
| 137 | + } |
| 138 | + |
| 139 | + /** |
| 140 | + * @return array |
| 141 | + */ |
| 142 | + protected function getFilterRules(): array |
| 143 | + { |
| 144 | + return [ |
| 145 | + 'slug' => ['=='], |
| 146 | + ]; |
| 147 | + } |
| 148 | + |
| 149 | + /** |
| 150 | + * @return array |
| 151 | + */ |
| 152 | + protected function getFilterValidatorRules(): array |
| 153 | + { |
| 154 | + return [ |
| 155 | + 'slug' => 'sometimes|required|string', |
| 156 | + ]; |
| 157 | + } |
| 158 | + |
| 159 | + public function getOrderRules(): array |
| 160 | + { |
| 161 | + return [ |
| 162 | + 'id', |
| 163 | + 'name', |
| 164 | + 'slug' |
| 165 | + ]; |
| 166 | + } |
| 167 | + |
173 | 168 | } |
0 commit comments