load(); return $this->query; } public function findByLevelId($levelid) { $this->load(array('levelid = ?', $levelid)); return $this->query; } public function findLevel() { $level = new Level($this->db); $level->getById($this->levelid); return $level; } 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(); } }