/**
  * @param Question $question
  * @return array
  */
 private function prepareQuestion(Question $question)
 {
     $questionData = array();
     $questionData['id'] = $question->getId();
     $questionData['title'] = $question->getTitle();
     $questionData['content'] = $question->getContent();
     $questionData['type'] = $question->getType();
     $questionData['nextQuestionId'] = $question->getNextQuestionId();
     $questionData['tickLength'] = $question->getTickLength();
     /**
      * @var PotentialAnswer $potentialAnswer
      */
     foreach ($question->getPotentialAnswers() as $potentialAnswer) {
         $questionData['potentialAnswers'][] = array('id' => $potentialAnswer->getId(), 'answer' => $potentialAnswer->getAnswer(), 'questionId' => $question->getId(), 'nextQuestionId' => $potentialAnswer->getNextQuestionId(), 'realAnswer' => $potentialAnswer->getRealAnswer());
     }
     /**
      * @var QuestionAttachment $attachment
      */
     foreach ($question->getAttachments() as $attachment) {
         $questionData['attachments'][] = array('id' => $attachment->getId(), 'title' => $attachment->getTitle(), 'path' => $attachment->getPath(), 'description' => $attachment->getDescription(), 'questionId' => $question->getId());
     }
     return $questionData;
 }