| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?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;
- $statement = $db->prepare("
- SELECT
- id,
- skill_group,
- level,
- effect
- FROM k_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"]);
- }
- }
- }
- ?>
|