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