* @license https://www.gnu.org/licenses/gpl-3.0.en.html GNU General Public License V3 * @package SWDB */ require_once(PATH::ENTITY . "Entity.php"); /** * Guild skill. * * Represents one of the guild skills aquired by leveling the guild up. * * @category Entity */ class Guild_Skill extends Entity{ /** * @var int Skill ID. */ private $id; /** * @var int Skill group ID. */ private $group; /** * @var int Reached skil level. */ private $level; /** * @var string Skill bonus, human readable. */ private $effect; /** * Constructor. * * Searches the database and retrieves the information about the * skill, populating it and it's items. * * @param int $id Skill identifier. */ public function __construct($id){ $statement = get_context()->get_db()->prepare(" SELECT id, skill_group, level, effect FROM key.guild_skill WHERE id = :id; "); $statement->bindValue(':id', $id, SQLITE3_TEXT); $r = $statement->execute()->fetchArray(SQLITE3_ASSOC); if ($r){ $this->id = $r["id"]; $this->group = $r["skill_group"]; $this->level = $r["level"]; $this->effect = HTML::e($r["effect"]); } } /** * Retrieves the guild skill identifier. * * @return int Skill ID. */ public function get_id(){ return $this->id; } /** * Retrieves the skill group identifier. * * @return int Group ID. */ public function get_group(){ return $this->group; } /** * Retrieves the skill level. * * @return int Skill level. */ public function get_level(){ return $this->level; } /** * Retrieves the skill efect description. * * @return string Skill description. */ public function get_effect(){ return $this->effect; } }