Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function deleteAction(string|int $id = null): ResponseInterface |
||
27 | { |
||
28 | $entity = $this->getSingle($id); |
||
|
|||
29 | |||
30 | if (!$entity) { |
||
31 | return $this->setRestErrorResponse(404); |
||
32 | } |
||
33 | |||
34 | $delete = $entity->delete(); |
||
35 | $this->view->setVars([ |
||
36 | 'delete' => $delete, |
||
37 | 'single' => $this->expose($entity), |
||
38 | 'messages' => $entity->getMessages(), |
||
39 | ]); |
||
40 | |||
41 | return $this->setRestResponse($delete); |
||
42 | } |
||
44 |