/**
  * @EXT\Route(
  *     "/api/cursus/location/create",
  *     name="api_post_cursus_location_creation",
  *     options = {"expose"=true}
  * )
  * @EXT\ParamConverter("user", converter="current_user")
  */
 public function postLocationCreateAction()
 {
     $locationDatas = $this->request->request->get('locationDatas', false);
     $location = new Location();
     $location->setType(Location::TYPE_TRAINING);
     $location->setName($locationDatas['name']);
     $location->setStreet($locationDatas['street']);
     $location->setStreetNumber($locationDatas['streetNumber']);
     $location->setBoxNumber($locationDatas['boxNumber']);
     $location->setPc($locationDatas['pc']);
     $location->setTown($locationDatas['town']);
     $location->setCountry($locationDatas['country']);
     $location->setPhone($locationDatas['phone']);
     $this->locationManager->create($location);
     $serializedLocation = $this->serializer->serialize($location, 'json', SerializationContext::create()->setGroups(['api_user_min']));
     return new JsonResponse($serializedLocation, 200);
 }