skill; } /** * Retrieves the skill level. * * @return number Skill level. */ public function get_level(){ return $this->level; } /** * Retrieves the upgrade at this level. * * @return string Skill level description. */ public function get_description(){ return $this->description; } /** * Constructor. * * Searches the database and retrieves the information about the * skill level, populating it and it's items. * * @param int $skill Skill identifier. * @param int $level Skill level. */ public function __construct($skill, $level){ $statement = get_context()->get_db()->prepare(" SELECT skill, level, description FROM skill_level WHERE skill = :skill AND level = :level; "); $statement->bindValue(':skill', $skill, SQLITE3_TEXT); $statement->bindValue(':level', $level, SQLITE3_TEXT); $r = $statement->execute()->fetchArray(SQLITE3_ASSOC); if ($r){ $this->skill = $r["skill"]; $this->level = $r["level"]; $this->description = HTML::e($r["description"]); } } } ?>