Ejemplo n.º 1
0
 /**
  * @EXT\Route(
  *     "/survey/question/relation/{relation}/switch",
  *     name="claro_survey_question_relation_mandatory_switch",
  *     options={"expose"=true}
  * )
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function surveyQuestionRelationMandatorySwitchAction(SurveyQuestionRelation $relation)
 {
     $survey = $relation->getSurvey();
     $this->checkSurveyRight($survey, 'EDIT');
     $relation->switchMandatory();
     $this->surveyManager->persistSurveyQuestionRelation($relation);
     $data = $relation->getMandatory() ? 'mandatory' : 'not_mandatory';
     return new Response($data, 200);
 }