/**
  * @param Quiz\QuizTagsGetterWrapper $wrapper
  * @return array|null
  */
 public function setupTags(QuizTagsGetterWrapper $wrapper)
 {
     $wrapper->setInput(array("questionId" => $this->getPagingRecord()->getQuestion()->getId()));
     $wrapper->setupQueryBuilder();
     $this->record['tags'] = $wrapper->getRecords();
     return $this->record['tags'];
 }
 /**
  * @param Request $request
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function indexAction(Request $request)
 {
     $em = $this->get('doctrine.orm.entity_manager');
     $topicsGetterWrapper = new TopicsGetterWrapper(new QuizQuestionsTopicsGetter($em));
     $topicsGetterWrapper->setupQueryBuilder();
     $topicsGetterWrapper->setInput(array());
     $quizTagsGetterWrapper = new QuizTagsGetterWrapper(new QuizTagsGetter($em));
     $quizTagsGetterWrapper->setInput(array('fields' => 'DISTINCT(qt.id) AS id, qt.name'));
     $quizTagsGetterWrapper->setupQueryBuilder();
     $topicsTreeSetup = new TopicsTreeSetup();
     $topicsTreeSetup->setTopicsGetterWrapper(new TopicsGetterWrapper(new TopicsGetter($em)));
     $topicsTreeSetup->setupTopicsFromDb(array());
     $topicsTreeSetup->setupRecordsTree();
     $interviewTopicsGetter = new TopicsGetterWrapper(new InterviewTopicsGetter($em));
     $interviewTopicsGetter->setupQueryBuilder();
     $interviewTopicsGetter->setInput(array());
     $interviewTagsGetterWrapper = new InterviewTagsGetterWrapper(new InterviewTagsGetter($em));
     $interviewTagsGetterWrapper->setInput(array('fields' => 'DISTINCT(t.id) AS tagId, t.name, t.slug'));
     $interviewTagsGetterWrapper->setupQueryBuilder();
     return $this->render('::default/index.html.twig', array('quizTopicsRecords' => $topicsGetterWrapper->getRecords(), 'quizTags' => $quizTagsGetterWrapper->getRecords(), 'interviewTopics' => $interviewTopicsGetter->getRecords(), 'interviewTags' => $interviewTagsGetterWrapper->getRecords(), 'topicsTree' => $topicsTreeSetup->getRecordsTree()));
 }