| Conditions | 2 |
| Paths | 3 |
| Total Lines | 24 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function readAction($uuid) |
||
| 14 | { |
||
| 15 | $databaseNotificationManager = $this->get('notification.database_notification_manager'); |
||
| 16 | |||
| 17 | try { |
||
| 18 | $databaseNotificationManager->findAndSetAsRead(['uuid' => $uuid]); |
||
| 19 | |||
| 20 | $code = 200; |
||
| 21 | $status = 'ok'; |
||
| 22 | $message = sprintf('Database notification %s marked as read', $uuid); |
||
| 23 | } catch (\Exception $e) { |
||
| 24 | $code = 500; |
||
| 25 | $status = 'error'; |
||
| 26 | $message = $e->getMessage(); |
||
| 27 | } |
||
| 28 | |||
| 29 | return new JsonResponse( |
||
| 30 | [ |
||
| 31 | 'status' => $status, |
||
| 32 | 'message' => $message, |
||
| 33 | ], |
||
| 34 | $code |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | } |
||
| 38 |