| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- /**
- * Skill level entity file.
- *
- * Creates the entity and makes it available.
- *
- * @category Entity
- */
- /**
- * Require dependent entities if not present.
- */
- require_once(PATH::ENTITY . "Entity.php");
- /**
- * Monster skill level.
- *
- * Represents an object from the table 'k_monster_skill_upgrade'.
- *
- * @category Entity
- */
- class K_Skill_Level extends Entity{
- /**
- * @var int Skill identifier.
- */
- public $skill;
- /**
- * @var int Skill level.
- */
- public $level;
- /**
- * @var string Upgrade description.
- */
- public $description;
- /**
- * Constructor.
- *
- * Searches the database and retrieves the information about the
- * skill level, populating it and it's items.
- *
- * @param resource $db Connection to the database.
- * @param int $skill Skill identifier.
- * @param int $level Skill level.
- */
- public function __construct($db, $skill, $level){
- parent::__construct($db);
- $s =
- "SELECT " .
- " skill, " .
- " level, " .
- " description " .
- "FROM k_skill_level " .
- "WHERE " .
- " skill = $skill AND " .
- " level = $level;";
- $q = $this->db->query($s);
- $r = $q->fetchArray(SQLITE3_ASSOC);
- if ($r){
- $this->skill = $r["skill"];
- $this->level = $r["level"];
- $this->description = HTML::e($r["description"]);
- }
- }
- }
- ?>
|