src/Controller/IndexController.php line 35

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Prediction;
  4. use App\Entity\PredictionGenerator;
  5. use App\Entity\Offre;
  6. use App\Entity\Participants;
  7. use App\Entity\Predictionfast;
  8. use App\Entity\PredictionMeilleuresCombinaisons;
  9. use App\Form\PredictionGeneratorType;
  10. use App\Repository\AbonnementRepository;
  11. use App\Repository\CoursesRepository;
  12. use App\Repository\OffreRepository;
  13. use App\Repository\ParticipantsRepository;
  14. use App\Repository\PerformanceRepository;
  15. use App\Repository\PredictionMeilleuresCombinaisonsRepository;
  16. use App\Repository\PredictionRepository;
  17. use App\Repository\ReunionsRepository;
  18. use Doctrine\ORM\EntityManager;
  19. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  20. use Symfony\Component\HttpFoundation\Request;
  21. use Symfony\Component\HttpFoundation\Response;
  22. use Symfony\Component\Routing\Annotation\Route;
  23. use Doctrine\Persistence\ManagerRegistry;
  24. use Symfony\Component\HttpFoundation\JsonResponse;
  25. // "/{reactRouting}", name="index", defaults={"reactRouting": null}, requirements={"reactRouting"=".+"}
  26. class IndexController extends AbstractCoreController
  27. {
  28.     /**
  29.      * @Route("/", name="index")
  30.      */
  31.     public function index(ManagerRegistry $doctrinePerformanceRepository $performanceRepository): Response
  32.     {
  33.         /* $slides_right = $doctrine->getManager()->getRepository(Prediction::class)->findWinningPredictions(10); */
  34.         // dd($slides_right);
  35.         /* $performancesData = $performanceRepository->findPerformances('1'); */
  36.         $tPariTypesKeys explode('|'$_ENV['PARI_TYPES_KEYS']);
  37.         $tPariTypesValues explode('|'$_ENV['PARI_TYPES_VALUES']);
  38.         $pari_types array_combine($tPariTypesKeys$tPariTypesValues);
  39.         $categories = array();
  40.         /* foreach ($performancesData as $key => $performance) {
  41.             foreach ($pari_types as $keyPari => $pari_type) {
  42.                 $categorie = [];
  43.                 $categorie['nom'] = $pari_type;
  44.                 $categorie['details'] = [];
  45.                 
  46.                 switch ($keyPari) {
  47.                     case 'SP':
  48.                         for ($i = 2; $i <= 4; ++$i) {
  49.                             $detail = [];
  50.                             $method = 'getSPen' . $i . 'Chev';
  51.                             if (method_exists($performance, $method)) {
  52.                                 $perfData = $performance->$method();
  53.                                 
  54.                                 if ($perfData < 0.1) {
  55.                                     break; // Sort de la boucle
  56.                                 }
  57.                                 $detail['valeur'] = round($perfData * 100, 2);
  58.                                 $detail['nbChevaux'] = $i;
  59.                                 $categorie['details'][] = $detail;
  60.                             }
  61.                         }
  62.                         break;
  63.                     case 'SG':
  64.                         for ($i = 3; $i <= 4; ++$i) {
  65.                             $detail = [];
  66.                             $method = 'getSGen' . $i . 'Chev';
  67.                             if (method_exists($performance, $method)) {
  68.                                 $perfData = $performance->$method();
  69.                                 if ($perfData < 0.15) {
  70.                                     break; // Sort de la boucle
  71.                                 }
  72.                                 $detail['valeur'] = round($perfData * 100, 2);
  73.                                 $detail['nbChevaux'] = $i;
  74.                                 $categorie['details'][] = $detail;
  75.                             }
  76.                         }
  77.                         break;
  78.     
  79.                     case 'CG':
  80.                         for ($i = 3; $i <= 4; ++$i) {
  81.                             $detail = [];
  82.                             $method = 'getCGen' . $i . 'Chev';
  83.                             if (method_exists($performance, $method)) {
  84.                                 $perfData = $performance->$method();
  85.                                 if ($perfData < 0.05) {
  86.                                     break; // Sort de la boucle
  87.                                 }
  88.                                 $detail['valeur'] = round($perfData * 100, 2);
  89.                                 $detail['nbChevaux'] = $i;
  90.                                 $categorie['details'][] = $detail;
  91.                             }
  92.                         }
  93.                         break;
  94.                     case 'CP':
  95.                         for ($i = 2; $i <= 4; ++$i) {
  96.                             $detail = [];
  97.                             $method = 'getCPen' . $i . 'Chev';
  98.                             if (method_exists($performance, $method)) {
  99.                                 $perfData = $performance->$method();
  100.                                 if ($perfData < 0.005) {
  101.                                     break; // Sort de la boucle
  102.                                 }
  103.                                 $detail['valeur'] = round($perfData * 100, 2);
  104.                                 $detail['nbChevaux'] = $i;
  105.                                 $categorie['details'][] = $detail;
  106.                             }
  107.                         }
  108.                         break;
  109.                     case 'deuxsur4':
  110.                         for ($i = 2; $i <= 4; ++$i) {
  111.                             $detail = [];
  112.                             $method = 'getdeuxsur4en' . $i . 'chev';
  113.                             if (method_exists($performance, $method)) {
  114.                                 $perfData = $performance->$method();
  115.                                 if ($perfData < 0.025) {
  116.                                     break; // Sort de la boucle
  117.                                 }
  118.                                 $detail['valeur'] = round($perfData * 100, 2);
  119.                                 $detail['nbChevaux'] = $i;
  120.                                 $categorie['details'][] = $detail;
  121.                             }
  122.                         }
  123.                         break;
  124.                     case 'trioDesordre':
  125.                         for ($i = 4; $i <= 4; ++$i) {
  126.                             $detail = [];
  127.                             $method = 'getTrioDesordreEn' . $i . 'Chev';
  128.                             if (method_exists($performance, $method)) {
  129.                                 $perfData = $performance->$method();
  130.                                 
  131.                                 if ($perfData < 0.05) {
  132.                                     break; // Sort de la boucle
  133.                                 }
  134.                                 $detail['valeur'] = round($perfData * 100, 2);
  135.                                 $detail['nbChevaux'] = $i;
  136.                                 $categorie['details'][] = $detail;
  137.                             }
  138.                         }
  139.                         break;
  140.                     case 'trioOrdre':
  141.                         for ($i = 4; $i <= 4; ++$i) {
  142.                             $detail = [];
  143.                             $method = 'getTrioOrdreEn' . $i . 'Chev';
  144.                             if (method_exists($performance, $method)) {
  145.                                 $perfData = $performance->$method();
  146.                                 if ($perfData < 0.005) {
  147.                                     break; // Sort de la boucle
  148.                                 }
  149.                                 $detail['valeur'] = round($perfData * 100, 2);
  150.                                 $detail['nbChevaux'] = $i;
  151.                                 $categorie['details'][] = $detail;
  152.                             }
  153.                         }
  154.                         break;
  155.                     case 'quarteDesordre':
  156.                         for ($i = 5; $i <= 4; ++$i) {
  157.                             $detail = [];
  158.                             $method = 'getQuarteDesordreEn' . $i . 'Chev';
  159.                             if (method_exists($performance, $method)) {
  160.                                 $perfData = $performance->$method();
  161.                                 if ($perfData < 0.00005) {
  162.                                     break; // Sort de la boucle
  163.                                 }
  164.                                 $detail['valeur'] = round($perfData * 100, 2);
  165.                                 $detail['nbChevaux'] = $i;
  166.                                 $categorie['details'][] = $detail;
  167.                             }
  168.                         }
  169.                         break;
  170.                     case 'quarteOrdre':
  171.                         for ($i = 5; $i <= 4; ++$i) {
  172.                             $detail = [];
  173.                             $method = 'getQuarteOrdreEn' . $i . 'Chev';
  174.                             if (method_exists($performance, $method)) {
  175.                                 $perfData = $performance->$method();
  176.                                 if ($perfData < 0.00005) {
  177.                                     break; // Sort de la boucle
  178.                                 }
  179.                                 $detail['valeur'] = round($perfData * 100, 2);
  180.                                 $detail['nbChevaux'] = $i;
  181.                                 $categorie['details'][] = $detail;
  182.                             }
  183.                         }
  184.                         break;
  185.                     case 'quinteDesordre':
  186.                         for ($i = 6; $i <= 4; ++$i) {
  187.                             $detail = [];
  188.                             $method = 'getQuinteDesordrEn' . $i . 'Chev';
  189.                             if (method_exists($performance, $method)) {
  190.                                 $perfData = $performance->$method();
  191.                                 if ($perfData < 0.000005) {
  192.                                     break; // Sort de la boucle
  193.                                 }
  194.                                 $detail['valeur'] = round($perfData * 100, 2);
  195.                                 $detail['nbChevaux'] = $i;
  196.                                 $categorie['details'][] = $detail;
  197.                             }
  198.                         }
  199.                         break;
  200.                     case 'quinteOrdre':
  201.                         for ($i = 6; $i <= 4; ++$i) {
  202.                             $detail = [];
  203.                             $method = 'getQuinteOrdreEn' . $i . 'Chev';
  204.                             if (method_exists($performance, $method)) {
  205.                                 $perfData = $performance->$method();
  206.                                 if ($perfData < 0.000005) {
  207.                                     break; // Sort de la boucle
  208.                                 }
  209.                                 $detail['valeur'] = round($perfData * 100, 2);
  210.                                 $detail['nbChevaux'] = $i;
  211.                                 $categorie['details'][] = $detail;
  212.                             }
  213.                         }
  214.                         break;
  215.                     default:
  216.                     // Si le type de pari n'est pas géré, vous pouvez soit ignorer, soit ajouter une valeur par défaut
  217.                     break;
  218.                 }
  219.                 
  220.                 if (!empty($categorie['details'])) {
  221.                     $categories[] = $categorie;
  222.                 }
  223.             }
  224.         }
  225.  */
  226.         /*
  227.         
  228.         $performances = array();
  229.         foreach ($performancesData as $key => $performance) {
  230.             foreach ($pari_types as $keyPari => $pari_type) {
  231.                 $performances[$keyPari]['type'] = $pari_type;
  232.                 for ($i = 0; $i < 4; ++$i) {
  233.                     switch ($keyPari) {
  234.                         case 'SP':
  235.                             switch ($i) {
  236.                                 case 0:
  237.                                     $perfData = $performance->getSPen1Chev();
  238.                                     break;
  239.                                 case 1:
  240.                                     $perfData = $performance->getSPen2Chev();
  241.                                     break;
  242.                                 case 2:
  243.                                     $perfData = $performance->getSPen3Chev();
  244.                                     break;
  245.                                 case 3:
  246.                                     $perfData = $performance->getSPen4Chev();
  247.                                     break;
  248.                                 case 4:
  249.                                     $perfData = $performance->getSPen5Chev();
  250.                                     break;
  251.                                 case 5:
  252.                                     $perfData = $performance->getSPen6Chev();
  253.                                     break;
  254.                                 case 6:
  255.                                     $perfData = $performance->getSPen7Chev();
  256.                                     break;
  257.                                 case 7:
  258.                                     $perfData = $performance->getSPen8Chev();
  259.                                     break;
  260.                                 default:
  261.                                     $perfData = 0.00;
  262.                                     break;
  263.                             }
  264.                             break;
  265.                         default:
  266.                             $perfData = 0.00;
  267.                             break;
  268.                     }
  269.                     $performances[$keyPari]['data'][$i] = round($perfData*100, 2);
  270.                 }
  271.             }
  272.         }
  273. */
  274.         return $this->render('index/index.html.twig', [
  275.             "categories" => $categories,
  276.             /* 'slides_right' => $slides_right, */
  277.         ]);
  278.     }
  279.     /**
  280.      * @Route("/program", name="program")
  281.      */
  282.     public function program(): Response
  283.     {
  284.         return $this->render('programme/index.html.twig');
  285.     }
  286.     /**
  287.      * @Route("/program/{date}/{course}", name="program_course")
  288.      */
  289.     public function programCourse($date$coursePredictionMeilleuresCombinaisonsRepository $predictionMeilleuresCombinaisonsRepositoryCoursesRepository $coursesRepositoryReunionsRepository $reunionsRepositoryAbonnementRepository $abonnementRepositoryRequest $request): Response
  290.     {
  291.         try {
  292.             $dateObj = new \DateTime($date);
  293.         } catch (\Exception $e) {
  294.             // Si la date est invalide, utiliser aujourd'hui
  295.             $dateObj = new \DateTime();
  296.         }
  297.         // Récupérer les réunions pour cette date
  298.         $reunions $reunionsRepository->findByDate($dateObj);
  299.         // Récupérer les courses pour cette réunion spécifique (si $course est un ID de course)
  300.         $courseDetails null;
  301.         if ($course) {
  302.             $courseDetails $coursesRepository->find($course);
  303.         }
  304.         // Récupérer les détails de la course sélectionnée
  305.         $courseDetails null;
  306.         $predictions = [];
  307.         // initialisation du variable pour la subscription
  308.         $hasActiveSubscription false;
  309.         // Vérifier si l'utilisateur est connecté
  310.         $user $this->getUser();
  311.         if ($user) {
  312.             $userPlatform $user->retrieveUserPlatform();
  313.             // Vérifier si l'utilisateur a un abonnement actif
  314.             $activeSubscriptions $abonnementRepository->findActiveSubscriptions($userPlatform);
  315.             $hasActiveSubscription = !empty($activeSubscriptions);
  316.         }
  317.         /* dd($activeSubscriptions); */
  318.         if ($course && is_numeric($course)) {
  319.             $courseDetails $coursesRepository->find($course);
  320.             // Récupérer les prédictions UNIQUEMENT si l'utilisateur est connecté et abonné
  321.             if ($courseDetails && $hasActiveSubscription) {
  322.                 $predictions $predictionMeilleuresCombinaisonsRepository->findByCourseId($course);
  323.             }
  324.         }
  325.         return $this->render('programme/course.html.twig', [
  326.             'date' => $dateObj,
  327.             'selectedCourseId' => $course,
  328.             'courseDetails' => $courseDetails,
  329.             'reunions' => $reunions,
  330.             'predictions' => $predictions,
  331.             'hasActiveSubscription' => $hasActiveSubscription,
  332.             'isUserLoggedIn' => $user !== null,
  333.         ]);
  334.         /* $predictionGenerator = new Predictionfast();
  335.         $form = $this->createForm(PredictionGeneratorType::class, $predictionGenerator);
  336.         $form->handleRequest($request);
  337.         if ($form->isSubmitted() && $form->isValid()) {
  338.             if($this->getUser()) {
  339.                 $predictionGenerator->setIdUser($this->getUser()->getId());
  340.             }
  341.             $predictionGenerator->setIdCoursePredict($course);
  342.             $entityManager = $this->getDoctrine()->getManager();
  343.             $entityManager->persist($predictionGenerator);
  344.             $entityManager->flush();
  345.             $this->addFlash('success', 'Votre demande a bien été soumise.');
  346.             return $this->redirectToRoute('program_course', ['date' => $date, 'course' => $course]);
  347.         }
  348.         $myPredictions =  [];
  349.         if($this->getUser()) {
  350.             $myPredictions = $predictionRepository->findBy(['idUser' => $this->getUser()->getId()]);
  351.         } */
  352.         /* return $this->render('programme/course.html.twig', [
  353.             'form' => $form->createView(),
  354.             'myPredictions' => $myPredictions,
  355.         ]); */
  356.     }
  357.     /**
  358.      * @Route("/api/reunion/{idReunion}/courses", name="api_reunion_courses")
  359.      */
  360.     public function getCoursesByReunion(int $idReunionCoursesRepository $coursesRepositoryReunionsRepository $reunionsRepository): JsonResponse
  361.     {
  362.         // Récupérer la réunion
  363.         $reunion $reunionsRepository->find($idReunion);
  364.         if (!$reunion) {
  365.             return $this->json(['error' => 'Réunion non trouvée'], 404);
  366.         }
  367.         // Récupérer les courses pour cette réunion
  368.         $courses $coursesRepository->findBy(
  369.             ['reunion' => $idReunion],
  370.             ['numeroCourse' => 'ASC']
  371.         );
  372.         $data = [];
  373.         foreach ($courses as $course) {
  374.             $data[] = [
  375.                 'id' => $course->getIdCourse(),
  376.                 'numeroCourse' => $course->getNumeroCourse(),
  377.                 'nom' => $course->getNom(),
  378.                 'heureDepart' => $course->getHeureDepart() ? $course->getHeureDepart()->format('H:i') : null,
  379.                 'discipline' => $course->getDiscipline(),
  380.                 'distance' => $course->getDistance(),
  381.                 'montant' => $course->getMontant(),
  382.                 'montantdevise' => $course->getMontantdevise(),
  383.                 'nbDeclaresPartants' => $course->getNbDeclaresPartants(),
  384.                 'etatTerrain' => $course->getEtatTerrain(),
  385.                 'specialite' => $course->getSpecialite(),
  386.                 'conditionsAge' => $course->getConditionsAge(),
  387.                 'corde' => $course->getCorde(),
  388.             ];
  389.         }
  390.         return $this->json([
  391.             'reunion' => [
  392.                 'id' => $reunion->getIdReunion(),
  393.                 'date' => $reunion->getDate() ? $reunion->getDate()->format('Y-m-d H:i:s') : null,
  394.                 'hippodrome' => $reunion->getHippodrome(),
  395.                 'numeroReunion' => $reunion->getNumeroReunion(),
  396.                 'pays' => $reunion->getPays(),
  397.             ],
  398.             'courses' => $data,
  399.             'coursesExemple' => $coursesRepository->findOneBy([], ['idCourse' => 'ASC'])
  400.         ]);
  401.     }
  402.     /**
  403.      * @Route("/api/course/{courseId}/predictions", name="api_course_predictions")
  404.      */
  405.     public function getPredictionsByCourse(string $courseIdPredictionMeilleuresCombinaisonsRepository $predictionsRepositoryAbonnementRepository $abonnementRepositoryOffreRepository $offreRepository): JsonResponse
  406.     {
  407.         // Vérifier si l'utilisateur est connecté
  408.         $user $this->getUser();
  409.         $userPlatform null;
  410.         $hasActiveSubscription false;
  411.         if ($user) {
  412.             $userPlatform $user->retrieveUserPlatform();
  413.             // Vérifier si l'utilisateur a un abonnement actif
  414.             if ($userPlatform) {
  415.                 $activeSubscriptions $abonnementRepository->findActiveSubscriptions($userPlatform);
  416.                 $hasActiveSubscription = !empty($activeSubscriptions);
  417.             }
  418.         }
  419.         // Récupérer les prédictions (maintenant accessible à tous)
  420.         $predictions $predictionsRepository->findByFkCourseIdGroupedByType($courseId);
  421.         /* $predictions = $predictionsRepository->findByCourseIdGroupedByType($courseId); */
  422.         $formattedPredictions = [];
  423.         foreach ($predictions as $typePari => $typePredictions) {
  424.             $formattedPredictions[$typePari] = [];
  425.             foreach ($typePredictions as $prediction) {
  426.                 // Préparer les données de base
  427.                 $predictionData = [
  428.                     'id' => $prediction->getIdPrediction(),
  429.                     'typePari' => $prediction->getTypePari(),
  430.                     'risque' => $prediction->getRisque(),
  431.                     'methodeCalcul' => $prediction->getMethodecalcul(),
  432.                     'batchSize' => $prediction->getBatchSize(),
  433.                     'combinaison' => $prediction->getCombinaison(),
  434.                     'nbPropositions' => $prediction->getNbPropositions(),
  435.                     'success' => $prediction->isSuccess(),
  436.                     'dateCreation' => $prediction->getDateCreation() ? $prediction->getDateCreation()->format('Y-m-d H:i:s') : null,
  437.                     'tauxReussite' => $prediction->getTauxReussite()
  438.                 ];
  439.                 // Gérer les positions selon le statut d'abonnement
  440.                 if ($hasActiveSubscription && $userPlatform) {
  441.                     // Utilisateur abonné : renvoyer les vraies positions
  442.                     $predictionData['positions'] = [
  443.                         'p1' => $prediction->getP1(),
  444.                         'p2' => $prediction->getP2(),
  445.                         'p3' => $prediction->getP3(),
  446.                         'p4' => $prediction->getP4(),
  447.                         'p5' => $prediction->getP5(),
  448.                         'p6' => $prediction->getP6(),
  449.                         'p7' => $prediction->getP7(),
  450.                         'p8' => $prediction->getP8(),
  451.                     ];
  452.                 } else {
  453.                     // Non-abonné : renvoyer des positions masquées
  454.                     // Créer des positions masquées avec "x" pour chaque position non-nulle
  455.                     $positions = [
  456.                         'p1' => $prediction->getP1() ? 'x' null,
  457.                         'p2' => $prediction->getP2() ? 'x' null,
  458.                         'p3' => $prediction->getP3() ? 'x' null,
  459.                         'p4' => $prediction->getP4() ? 'x' null,
  460.                         'p5' => $prediction->getP5() ? 'x' null,
  461.                         'p6' => $prediction->getP6() ? 'x' null,
  462.                         'p7' => $prediction->getP7() ? 'x' null,
  463.                         'p8' => $prediction->getP8() ? 'x' null,
  464.                     ];
  465.                     // Calculer combien de positions sont non-nulles pour garder le même nombre de "x"
  466.                     $positionCount 0;
  467.                     for ($i 1$i <= 8$i++) {
  468.                         $getter 'getP' $i;
  469.                         if ($prediction->$getter()) {
  470.                             $positionCount++;
  471.                         }
  472.                     }
  473.                     $predictionData['positions'] = $positions;
  474.                     $predictionData['maskedPositionsCount'] = $positionCount// Pour information si besoin
  475.                 }
  476.                 $formattedPredictions[$typePari][] = $predictionData;
  477.             }
  478.         }
  479.         // Ajouter le statut d'abonnement dans la réponse pour le frontend
  480.         $responseData = [
  481.             'predictions' => $formattedPredictions,
  482.             'userStatus' => [
  483.                 'isLoggedIn' => ($userPlatform !== null),
  484.                 'hasActiveSubscription' => $hasActiveSubscription,
  485.                 /* 'userPlatform' => [
  486.                     'id' => $userPlatform?->getId()
  487.                 ],
  488.                 'offre' => $offreRepository->findAll() */
  489.             ],
  490.             /* 'Allprediction' => $predictionsRepository->findOneBy([], ['idPrediction' => 'ASC']), */
  491.             /* 'prediction_pour_course_409241 ' => $predictionsRepository->findByFkCourseIdGroupedByType(409241) */
  492.         ];
  493.         return $this->json($responseData);
  494.     }
  495.     /**
  496.      * @Route("/api/course/{courseId}/participants", name="api_course_participants")
  497.      */
  498.     public function getParticipantsByCourse(int $courseIdParticipantsRepository $participantsRepositoryOffreRepository $offreRepositoryPredictionMeilleuresCombinaisonsRepository $predictionMeilleuresCombinaisonsRepository): JsonResponse
  499.     {
  500.         // Récupérer les participants pour cette course
  501.         $participants $participantsRepository->findBy(
  502.             ['course' => $courseId],
  503.             ['numero' => 'ASC']
  504.         );
  505.         /* $predictions = $predictionMeilleuresCombinaisonsRepository->findBy(
  506.             [], // Critères (vide pour tous)
  507.             ['id' => 'DESC'], // Tri
  508.             12, // Limite
  509.             0 // Offset
  510.         ); */
  511.         /* $predictionTest = $predictionMeilleuresCombinaisonsRepository->findAll(); */
  512.         // Tri numérique manuel
  513.         usort($participants, function ($a$b) {
  514.             return (int)$a->getNumero() <=> (int)$b->getNumero();
  515.         });
  516.         $formattedParticipants = [];
  517.         foreach ($participants as $participant) {
  518.             $formattedParticipants[] = [
  519.                 'id' => $participant->getIdParticipant(),
  520.                 'numero' => $participant->getNumero(),
  521.                 'nom' => $participant->getNom(),
  522.                 'jockey' => $participant->getJockey(),
  523.                 'entraineur' => $participant->getEntraineur(),
  524.                 'sexe' => $participant->getSexe(),
  525.                 'age' => $participant->getAge(),
  526.                 'distance' => $participant->getDistance(),
  527.                 'dateNaissance' => $participant->getDateNaissance() ? $participant->getDateNaissance()->format('Y-m-d') : null,
  528.                 'poids' => $participant->getPoids(),
  529.                 'poidsUnite' => $participant->getPoidsUnite(),
  530.                 'oeilleres' => $participant->getOeilleres(),
  531.                 'deferes' => $participant->getDeferes(),
  532.                 'corde' => $participant->getCorde(),
  533.                 'cote' => $participant->getCote(),
  534.                 'statutDepart' => $participant->getStatutDepart(),
  535.                 'arrivee' => $participant->getArrivee(),
  536.                 'musique' => $participant->getMusique(),
  537.                 'tempsRecord' => $participant->getTempsRecord(),
  538.                 'gains' => $participant->getGains(),
  539.                 'confianceEntourage' => $participant->getConfianceEntourage(),
  540.             ];
  541.         }
  542.         return $this->json([
  543.             'courseId' => $courseId,
  544.             'participants' => $formattedParticipants,
  545.             'count' => count($formattedParticipants),
  546.             /* 'predictionTest' => $predictionTest */
  547.         ]);
  548.     }
  549. }