| @@ 107-120 (lines=14) @@ | ||
| 104 | $this->entityManager->flush(); |
|
| 105 | } |
|
| 106 | ||
| 107 | public function onKernelResponse(ResponseEvent $event): void |
|
| 108 | { |
|
| 109 | if (!$event->isMasterRequest()) { |
|
| 110 | return; |
|
| 111 | } |
|
| 112 | ||
| 113 | if ($this->requestLog) { |
|
| 114 | $this->requestLog->setFinishedAt(new \DateTimeImmutable()); |
|
| 115 | $this->requestLog->setSuccessful(true); |
|
| 116 | ||
| 117 | $this->entityManager->persist($this->requestLog); |
|
| 118 | $this->entityManager->flush(); |
|
| 119 | } |
|
| 120 | } |
|
| 121 | ||
| 122 | public function onKernelException(ExceptionEvent $event): void |
|
| 123 | { |
|
| @@ 122-134 (lines=13) @@ | ||
| 119 | } |
|
| 120 | } |
|
| 121 | ||
| 122 | public function onKernelException(ExceptionEvent $event): void |
|
| 123 | { |
|
| 124 | if (!$event->isMasterRequest()) { |
|
| 125 | return; |
|
| 126 | } |
|
| 127 | ||
| 128 | if (null === $this->requestLog) { |
|
| 129 | $this->requestLog->setSuccessful(false); |
|
| 130 | ||
| 131 | $this->entityManager->persist($this->requestLog); |
|
| 132 | $this->entityManager->flush(); |
|
| 133 | } |
|
| 134 | } |
|
| 135 | } |
|
| 136 | ||