| @@ 58-64 (lines=7) @@ | ||
| 55 | { |
|
| 56 | $em = $this->getDoctrine()->getManager(); |
|
| 57 | $answers = $em->getRepository(SurveyAnswer::class)->findAnswersBySurvey($survey); |
|
| 58 | if ($answers) { |
|
| 59 | foreach ($answers as $answer) { |
|
| 60 | $questions[] = $answer->getQuestion()->getId(); |
|
| 61 | $contents[] = $answer->getContent(); |
|
| 62 | } |
|
| 63 | $questionAnswer = array_combine($questions, $contents); |
|
| 64 | } |
|
| 65 | if (!$answers) { |
|
| 66 | $questionAnswer = null; |
|
| 67 | } |
|
| @@ 108-114 (lines=7) @@ | ||
| 105 | { |
|
| 106 | $em = $this->getDoctrine()->getManager(); |
|
| 107 | $answers = $em->getRepository(SurveyAnswer::class)->findAnswersBySurvey($survey); |
|
| 108 | if ($answers) { |
|
| 109 | foreach ($answers as $answer) { |
|
| 110 | $questions[] = $answer->getQuestion()->getId(); |
|
| 111 | $contents[] = $answer->getContent(); |
|
| 112 | } |
|
| 113 | $questionAnswer = array_combine($questions, $contents); |
|
| 114 | } |
|
| 115 | if (!$answers) { |
|
| 116 | $questionAnswer = null; |
|
| 117 | } |
|