/**
  * Retrieve the special words from the database.
  */
 public function execute()
 {
     global $wgUser;
     if (!$wgUser->isAllowed('surveyadmin') || $wgUser->isBlocked()) {
         $this->dieUsageMsg(array('badaccess-groups'));
     }
     // Get the requests parameters.
     $params = $this->extractRequestParams();
     $starPropPosition = array_search('*', $params['props']);
     if ($starPropPosition !== false) {
         unset($params['props'][$starPropPosition]);
         $params['props'] = array_merge($params['props'], SurveyAnswer::getFieldNames());
     }
     $params = array_filter($params, function ($param) {
         return !is_null($param);
     });
     $answers = SurveyAnswer::select($params['props'], SurveyAnswer::getValidFields($params), array('LIMIT' => $params['limit'] + 1, 'ORDER BY' => SurveyAnswer::getPrefixedField('id') . ' ASC'));
     $serializedAnswers = array();
     $count = 0;
     foreach ($answers as $answer) {
         if (++$count > $params['limit']) {
             // We've reached the one extra which shows that
             // there are additional pages to be had. Stop here...
             $this->setContinueEnumParameter('continue', $answer->getId());
             break;
         }
         $serializedAnswers[] = $answer->toArray();
     }
     $this->getResult()->setIndexedTagName($serializedAnswers, 'answer');
     $this->getResult()->addValue(null, 'answers', $serializedAnswers);
 }