setParent($parent); } public function getAll() { $this->loadQuestions(); return $this; } public function getPrintVersion() { $this->loadQuestions(); $content = theme('chgk_db_tour', $this); return theme('chgk_db_print', $this->getLongTitle(), $content); } public function loadQuestions() { if (isset($this->questions)) return; $this->questions = array(); $res = $this->db->getQuestionsRes($this->getDbId()); $factory = new DbQuestionFactory(); while ($row = $this->db->fetch_row($res)) { $this->questions[$row->Number] = $factory->getQuestion($row); } } public function setParent($parent = FALSE) { if ($parent) { $this->parent = $parent; } else { $this->parent = new DbPackageChamp($this->tour->ParentId); } } public function getParent() { if ($this->parent) { return $this->parent; } return FALSE; } public function getLongTitle() { return $this-> getParent()->getTitle(). ' '. $this->getTitle(); } public function getParentInfo() { return $this->parent->getInfo(); } public function getParentEditor() { return $this->parent->getEditor(); } }