| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?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 'guild_skill'.
- *
- * @category Entity
- */
- class Guild_Skill extends Entity{
- private $id;
- private $group;
- private $level;
- private $effect;
- /**
- * Constructor.
- *
- * Searches the database and retrieves the information about the
- * skill, populating it and it's items.
- *
- * @param int $id Skill identifier.
- */
- public function __construct($id){
- $statement = get_context()->get_db()->prepare("
- SELECT
- id,
- skill_group,
- level,
- effect
- FROM key.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"]);
- }
- }
-
- /**
- * Retrieves the guild skill identifier.
- *
- * @return int Skill ID.
- */
- public function get_id(){
- return $this->id;
- }
-
- /**
- * Retrieves the skill group identifier.
- *
- * @return int Group ID.
- */
- public function get_group(){
- return $this->group;
- }
-
- /**
- * Retrieves the skill level.
- *
- * @return int Skill level.
- */
- public function get_level(){
- return $this->level;
- }
-
- /**
- * Retrieves the skill efect description.
- *
- * @return string Skill description.
- */
- public function get_effect(){
- return $this->effect;
- }
- }
- ?>
|