| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?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 resource $db Connection to the database.
- * @param int $id Skill identifier.
- */
- public function __construct($db, $id){
- parent::__construct($db);
- $s =
- "SELECT " .
- " id, " .
- " skill_group, " .
- " level, " .
- " effect " .
- "FROM k_guild_skill " .
- "WHERE id = $id; ";
- $q = $this->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"]);
- }
- }
- }
- ?>
|