| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- /**
- * Guild skill entity file.
- *
- * Creates the entity and makes it available.
- *
- * @category Entity
- */
- /**
- * Require dependent entities if not present.
- */
- require_once(PATH::ENTITY . "Entity.php");
- /**
- * Guild skill.
- *
- * Represents an object from the table 'k_guild_skill'.
- *
- * @category Entity
- */
- class K_Guild_Skill extends Entity{
- /**
- * @var int Skill identifier.
- */
- public $id;
- /**
- * @var int Skill group id.
- */
- public $group;
- /**
- * @var int Level at which the skill becames available.
- */
- public $level;
- /**
- * @var string Skill description.
- */
- public $effect;
- /**
- * Constructor.
- *
- * Searches the database and retrieves the information about the
- * skill, populating it and it's items.
- *
- * @param int $id Skill identifier.
- * @global resource Database connection.
- */
- public function __construct($id){
- global $db;
- $s =
- "SELECT " .
- " id, " .
- " skill_group, " .
- " level, " .
- " effect " .
- "FROM k_guild_skill " .
- "WHERE id = $id; ";
- $q = $db->query($s);
- $r = $q->fetchArray(SQLITE3_ASSOC);
- if ($r){
- $this->id = $r["id"];
- $this->group = $r["skill_group"];
- $this->level = $r["level"];
- $this->effect = HTML::e($r["effect"]);
- }
- }
- }
- ?>
|