| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?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 int $skill Skill identifier.
- * @param int $level Skill level.
- * @global resource Database connection.
- */
- public function __construct($skill, $level){
- global $db;
- $statement = $db->prepare("
- SELECT
- skill,
- level,
- description
- FROM k_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"]);
- }
- }
- }
- ?>
|