| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <?php
- require_once($path["entity"] . "Entity.php");
- /**
- * Guild.
- *
- * Represents an object from the table 'guild'.
- */
- class Guild_Member extends Entity{
- /**
- * Member identifier.
- */
- public $id;
- /**
- * Guild id.
- */
- public $guild;
- /**
- * Member name.
- */
- public $name;
- /**
- * Member level.
- */
- public $level;
- /**
- * Member grade.
- */
- public $grade;
- /**
- * Memeber rating.
- */
- public $rating;
- /**
- * Memebr arena score.
- */
- public $arena_score;
- /**
- * Timestam the user joined the guild.
- */
- public $joined;
- /**
- * Timestamp the user last log on.
- */
- public $last_login;
- /**
- * Indicates if the member is included in guild wars.
- */
- public $in_war;
- /**
- * Indicates if the member has set guild wars defenses.
- */
- public $has_defense;
- /**
- * Constructor.
- *
- * Searches the database and retrieves the information about the
- * guild, populating it and it's items.
- *
- * @param SQLite3 $db Connection to the database.
- * @param int $id Guild identifier.
- */
- public function __construct($db, $id){
- global $path;
- parent::__construct($db);
- $s =
- "SELECT " .
- " id, " .
- " guild, " .
- " name, " .
- " level, " .
- " grade, " .
- " rating, " .
- " arena_score, " .
- " joined, " .
- " last_login, " .
- " in_war, " .
- " has_defense " .
- "FROM guild_member " .
- "WHERE id = $id; ";
- $q = $this->db->query($s);
- $r = $q->fetchArray(SQLITE3_ASSOC);
- if ($r){
- $this->id = $r["id"];
- $this->guild = $r["guild"];
- $this->name = $r["name"];
- $this->level = $r["level"];
- $this->grade = $r["grade"];
- $this->rating = $r["rating"];
- $this->arena_score = $r["arena_score"];
- $this->joined = $r["joined"];
- $this->last_login = $r["last_login"];
- $this->in_war = $r["in_war"];
- $this->has_defense = $r["has_defense"];
- }
- }
- }
- ?>
|