コード例 #1
0
 /**
  * @EXT\Route(
  *     "/course/session/{session}/self/register",
  *     name="claro_cursus_course_session_self_register",
  *     options={"expose"=true}
  * )
  * @EXT\ParamConverter("authenticatedUser", options={"authenticatedUser" = true})
  */
 public function courseSessionSelfRegisterAction(CourseSession $session, User $authenticatedUser)
 {
     $results = null;
     if ($session->getPublicRegistration()) {
         if ($session->hasValidation()) {
             $this->cursusManager->addUserToSessionQueue($authenticatedUser, $session);
         } else {
             $results = $this->cursusManager->registerUsersToSession($session, [$authenticatedUser], 0);
         }
     }
     return new JsonResponse($results, 200);
 }