@@ 169-186 (lines=18) @@ | ||
166 | /** |
|
167 | * @inheritdoc |
|
168 | */ |
|
169 | public static function delete( |
|
170 | array $routeParams, |
|
171 | ContainerInterface $container, |
|
172 | ServerRequestInterface $request |
|
173 | ): ResponseInterface { |
|
174 | static::assertClassValueDefined(static::API_CLASS); |
|
175 | ||
176 | $response = static::defaultDeleteHandler( |
|
177 | $routeParams[static::ROUTE_KEY_INDEX], |
|
178 | $request->getUri(), |
|
179 | static::defaultCreateApi($container, static::API_CLASS), |
|
180 | $container->get(SettingsProviderInterface::class), |
|
181 | $container->get(JsonSchemasInterface::class), |
|
182 | $container->get(EncoderInterface::class) |
|
183 | ); |
|
184 | ||
185 | return $response; |
|
186 | } |
|
187 | ||
188 | /** |
|
189 | * @param string $index |
|
@@ 327-348 (lines=22) @@ | ||
324 | * @throws ContainerExceptionInterface |
|
325 | * @throws NotFoundExceptionInterface |
|
326 | */ |
|
327 | protected static function deleteInRelationship( |
|
328 | string $parentIndex, |
|
329 | string $modelRelName, |
|
330 | string $childIndex, |
|
331 | string $childApiClass, |
|
332 | ContainerInterface $container, |
|
333 | ServerRequestInterface $request |
|
334 | ): ResponseInterface { |
|
335 | static::assertClassValueDefined(static::API_CLASS); |
|
336 | ||
337 | return static::defaultDeleteInRelationshipHandler( |
|
338 | $parentIndex, |
|
339 | $modelRelName, |
|
340 | $childIndex, |
|
341 | $request->getUri(), |
|
342 | static::defaultCreateApi($container, static::API_CLASS), |
|
343 | static::defaultCreateApi($container, $childApiClass), |
|
344 | $container->get(SettingsProviderInterface::class), |
|
345 | $container->get(JsonSchemasInterface::class), |
|
346 | $container->get(EncoderInterface::class) |
|
347 | ); |
|
348 | } |
|
349 | } |
|
350 |