| @@ 83-89 (lines=7) @@ | ||
| 80 | $em->flush(); |
|
| 81 | } |
|
| 82 | $answers = $em->getRepository(SurveyAnswer::class)->findAnswersBySurvey($survey); |
|
| 83 | if ($answers) { |
|
| 84 | foreach ($answers as $answer) { |
|
| 85 | $questions[] = $answer->getQuestion()->getId(); |
|
| 86 | $contents[] = $answer->getContent(); |
|
| 87 | } |
|
| 88 | $questionAnswer = array_combine($questions, $contents); |
|
| 89 | } |
|
| 90 | if (!$answers) { |
|
| 91 | $questionAnswer = null; |
|
| 92 | } |
|
| @@ 133-139 (lines=7) @@ | ||
| 130 | { |
|
| 131 | $em = $this->getDoctrine()->getManager(); |
|
| 132 | $answers = $em->getRepository(SurveyAnswer::class)->findAnswersBySurvey($survey); |
|
| 133 | if ($answers) { |
|
| 134 | foreach ($answers as $answer) { |
|
| 135 | $questions[] = $answer->getQuestion()->getId(); |
|
| 136 | $contents[] = $answer->getContent(); |
|
| 137 | } |
|
| 138 | $questionAnswer = array_combine($questions, $contents); |
|
| 139 | } |
|
| 140 | if (!$answers) { |
|
| 141 | $questionAnswer = null; |
|
| 142 | } |
|