load(); return $this->query; } public function add() { $this->copyFrom('POST'); $this->save(); } public function getById($id) { $this->load(array('id=?', $id)); } public function findModules() { $modules = new Module($this->db); return $modules->findByCourseId($this->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(); } }