/**
  * @EXT\Route(
  *     "/api/cursus/location/{location}/edit",
  *     name="api_put_cursus_location_edition",
  *     options = {"expose"=true}
  * )
  * @EXT\ParamConverter("user", converter="current_user")
  */
 public function putLocationEditAction(Location $location)
 {
     if ($location->getType() !== Location::TYPE_TRAINING) {
         throw new AccessDeniedException();
     }
     $locationDatas = $this->request->request->get('locationDatas', false);
     $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->edit($location);
     $serializedLocation = $this->serializer->serialize($location, 'json', SerializationContext::create()->setGroups(['api_user_min']));
     return new JsonResponse($serializedLocation, 200);
 }