Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function inviteDelete($id): ?string |
||
31 | { |
||
32 | $record = Invite::find($id); |
||
33 | if (!$record) { |
||
34 | throw new NotFoundException(__('Invite with id %id% not exist', ['id' => $id])); |
||
35 | } |
||
36 | |||
37 | $model = new FormInviteDelete($record); |
||
38 | if ($model->send() && $model->validate()) { |
||
39 | $model->make(); |
||
40 | App::$Session->getFlashBag()->add('success', __('Invite successful removed')); |
||
41 | $this->response->redirect('user/invitelist'); |
||
42 | } |
||
43 | |||
44 | return $this->view->render('user/invite_delete', [ |
||
45 | 'record' => $record, |
||
46 | 'model' => $model |
||
47 | ]); |
||
49 | } |