public function getQuestionsOfQuiz($quizId) { $questions = array(); $quizId = (int) $quizId; $managerProp = new PropositionManager(); $result = $this->_access->getResults($this->_access->prepare("SELECT * FROM " . StudyPressDB::getTableNameQuestions() . " WHERE " . StudyPressDB::COL_ID_QUIZ_QUESTION . " = '%d' ORDER BY " . StudyPressDB::COL_ORDER_QUESTION . " ASC", $quizId)); foreach ($result as $row) { $question = self::returnedQuestion($row); if ($question) { $question->setPropositions($managerProp->getPropositionsOfQuestion($question->getId())); array_push($questions, $question); } } return $questions; }