Beispiel #1
0
 public function getQuestionBySurvey(SxCms_Survey $survey)
 {
     $db = Zend_Registry::get('db');
     $select = $db->select()->from(array('sq' => 'SurveyQuestion'), array('*'))->where('sq.survey_id = ?', $survey->getId())->where('sq.language = ?', $survey->getLanguage());
     $results = $db->fetchAll($select);
     foreach ($results as $result) {
         $question = new SxCms_Survey_Question();
         $question->setId($result['question_id'])->setSurveyId($result['survey_id'])->setLanguage($result['language'])->setQuestion($result['question'])->setType($result['type'])->setComment($result['comment']);
         $survey->addQuestion($question, $result['question_id']);
         $proxy = new SxCms_Survey_Question_Answer_Proxy();
         $proxy->getAnswerByQuestion($question);
     }
     return;
 }