src/EventSubscriber/PageLoadedSubscriber.php line 18

  1. <?php
  2. namespace App\EventSubscriber;
  3. use App\Repository\EvaluationRepository;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. use Symfony\Component\HttpKernel\Event\TerminateEvent;
  6. use Symfony\Component\HttpKernel\KernelEvents;
  7. class PageLoadedSubscriber implements EventSubscriberInterface
  8. {
  9.     public function __construct(private EvaluationRepository $evaluationRepository)
  10.     {
  11.         
  12.     }
  13.     public function onKernelTerminate(TerminateEvent $event): void
  14.     {
  15.         $passedEvals $this->evaluationRepository->updatePassedDate(new \DateTime());
  16.     }
  17.     public static function getSubscribedEvents(): array
  18.     {
  19.         return [
  20.             KernelEvents::TERMINATE => 'onKernelTerminate',
  21.         ];
  22.     }
  23. }