load(); return $this->query; } public function findByModuleId($moduleid) { $this->load(array('moduleid = ?', $moduleid)); return $this->query; } public function findQuestions() { $question = new Question($this->db); return $question->findByLevelId($this->id); } public function findModule() { $module = new Module($this->db); $module->getById($this->moduleid); return $module; } public function add() { $this->copyFrom('POST'); $this->save(); } public function getById($id) { $this->load(array('id=?', $id)); } public function edit($id) { $this->load(array('id=?', $id)); $this->copyFrom('POST'); $this->update(); } public function delete($id) { $this->load(array('id=?', $id)); $this->erase(); } }