Requirement::UUID])] #[IsGranted('ROLE_ADMINISTRATIVE')] public function index( #[MapEntity(mapping: ['uuid' => 'uuid'])] QuestionnaireResponse $response, Request $request, ): Response { // a draft is still the teamer's if (false === $response->isSubmitted()) { throw new NotFoundHttpException(); } // the other questionnaire of the same placement, e.g. the bus feedback beside the teamer feedback $siblings = array_filter( $this->responseRepository->findByDisposition($response->getDisposition()), static fn (QuestionnaireResponse $sibling): bool => $sibling !== $response && $sibling->isSubmitted(), ); return $this->render('administrative/questionnaire/detail.html.twig', [ 'definition' => $this->catalog->get($response->getQuestionnaire(), $response->getVersion()), 'response' => $response, 'siblings' => array_map(fn (QuestionnaireResponse $sibling): array => [ 'response' => $sibling, 'title' => $this->catalog->get($sibling->getQuestionnaire(), $sibling->getVersion())->title, ], array_values($siblings)), 'returnUrl' => $this->getReturnUrl($request, 'app_administrative_questionnaire_index'), ]); } }