load(); return $this->query; } public function findCourse() { $course = new Course($this->db); $course->getById($this->courseid); return $course; } public function findLevels() { $level = new Level($this->db); return $level->findByModuleId($this->id); } public function findByCourseId($courseid) { $this->load(array('courseid=?', $courseid)); return $this->query; } 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(); } }