| Conditions | 4 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function clear($id): ?string |
||
| 31 | { |
||
| 32 | // find user object by passed id |
||
| 33 | $user = User::with('profile')->find($id); |
||
| 34 | if (!$user) { |
||
| 35 | throw new NotFoundException(__('User not found')); |
||
| 36 | } |
||
| 37 | |||
| 38 | // initialize and process form model |
||
| 39 | $model = new FormUserClear($user); |
||
| 40 | if ($model->send() && $model->validate()) { |
||
| 41 | $model->make(); |
||
| 42 | App::$Session->getFlashBag()->add('success', __('User input data clear successful')); |
||
| 43 | $this->response->redirect('user/index'); |
||
| 44 | } |
||
| 45 | |||
| 46 | // render output view |
||
| 47 | return $this->view->render('user/user_clear', [ |
||
| 48 | 'model' => $model |
||
| 49 | ]); |
||
| 51 | } |