Exemple #1
0
 /**
  * @return Question
  */
 protected function getQuestion()
 {
     $question = new Question();
     $question->setTemplate('OrtofitQuizBundle:Quiz:question.html.twig');
     $question->setContent('QuestionContent');
     $question->setId(1);
     $question->setIndex(1);
     $question->setName('QuestionName');
     $question->setPosition(Question::VARIANT_POSITION_HORIZON);
     return $question;
 }
 /**
  * Load data fixtures with the passed EntityManager
  *
  * @param ObjectManager $manager
  */
 public function load(ObjectManager $manager)
 {
     /** @var Quiz $quiz */
     $quiz = $this->getReference('quiz:feet');
     foreach ($this->loadData as $data) {
         $question = new Question();
         $question->setQuiz($quiz);
         $question->setName($data['name']);
         $question->setIndex($data['index']);
         $question->setContent($data['content']);
         $question->setPosition($data['position']);
         $question->setTemplate('OrtofitQuizBundle:Quiz:question.html.twig');
         $manager->persist($question);
         $this->setReference($data['reference'], $question);
     }
     $manager->flush();
 }
Exemple #3
0
 /**
  * @return string
  */
 protected function getTemplate()
 {
     return $this->question->getTemplate();
 }