private function loadQuestions() { $res = $this->db->authorQuestionsRes($this->id, self::QUESTIONS_NUMBER); $this->questions = array(); $factory = new DbQuestionFactory(); while ($questionRow = db_fetch_object($res)) { $this->questions[] = $factory->getQuestion($questionRow); } }
protected function getQuestion() { if ($this->question !== NULL) { return $this->question; } $factory = new DbQuestionFactory(); $this->question = $factory->getQuestionFromTextId($this->node->title); if ($this->question) { $this->question->setForSearch(); $this->question->setNoContact(); } return $this->question; }
private function getQuestion() { if (!$this->question) { ctools_include('object-cache'); $this->question = ctools_object_cache_get('ctools_ajax_sample', $this->getQuestionId()); } if (!$this->question) { module_load_include('class.php', 'chgk_db', 'classes/DbQuestionFactory'); $factory = new DbQuestionFactory(); $this->question = $factory->getQuestionFromTextId($this->getQuestionId()); } return $this->question; }
public function getQuestion($number, $tour = FALSE) { if (!$tour) { $tour = 1; } if (isset($this->tours[$tour]) && ($q = $this->tours[$tour]->getQuestion($number))) { return $q; } $factory = new DbQuestionFactory(); $row = $this->db->getQuestionByNumber($this->getDbId(), $number, TRUE); return $factory->getQuestion($row); }
public function getQuestion($number) { if (isset($this->questions[$number])) { return $this->questions[$number]; } else { $factory = new DbQuestionFactory(); $row = $this->db->getQuestionByNumber($this->getDbId(), $number); return $factory->getQuestion($row); } }
protected function makeRandomResults() { $factory = new DbQuestionFactory(); $this->results = array(); while ($a = db_fetch_object($this->mysqlRes)) { $q = $factory->getQuestion($a); if ($this->withAnswers) { $q->doNotHideAnswer = true; } $this->results[] = $q; } }