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