| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- /**
- * Guild skill entity file.
- *
- * Creates the entity and makes it available.
- *
- * @author Iñigo Valentin <i@inigovalentin.com>
- * @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;
- }
- }
|