- //Count session at location in last month for guest
- if (!$this->isGranted('ROLE_REGULAR') && !empty($session = $doctrine->getRepository(Session::class)->findOneWithinLastMonthByLocationUser($data['location']->getId(), $this->getUser()->getId()))) {
- //Add warning in flash message
- $this->addFlash('warning', $this->translator->trans('Monthly application %location% already exists', ['%location%' => $this->translator->trans('at '.$data['location'])]));
-
- //Redirect to cleanup the form
- return $this->redirectToRoute('rapsys_air_session_view', ['id' => $session['id']]);
- }
-