| @@ 66-72 (lines=7) @@ | ||
| 63 | $em->flush(); | |
| 64 | } | |
| 65 | $answers = $em->getRepository(SurveyAnswer::class)->findAnswersBySurvey($survey); | |
| 66 |         if ($answers) { | |
| 67 |             foreach ($answers as $answer) { | |
| 68 | $questions[] = $answer->getQuestion()->getId(); | |
| 69 | $contents[] = $answer->getContent(); | |
| 70 | } | |
| 71 | $questionAnswer = array_combine($questions, $contents); | |
| 72 | } | |
| 73 |         if (!$answers) { | |
| 74 | $questionAnswer = null; | |
| 75 | } | |
| @@ 116-122 (lines=7) @@ | ||
| 113 |     { | |
| 114 | $em = $this->getDoctrine()->getManager(); | |
| 115 | $answers = $em->getRepository(SurveyAnswer::class)->findAnswersBySurvey($survey); | |
| 116 |         if ($answers) { | |
| 117 |             foreach ($answers as $answer) { | |
| 118 | $questions[] = $answer->getQuestion()->getId(); | |
| 119 | $contents[] = $answer->getContent(); | |
| 120 | } | |
| 121 | $questionAnswer = array_combine($questions, $contents); | |
| 122 | } | |
| 123 |         if (!$answers) { | |
| 124 | $questionAnswer = null; | |
| 125 | } | |