|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
|
|
require_once($path["entity"] . "Entity.php");
|
|
require_once($path["entity"] . "Entity.php");
|
|
|
require_once($path["entity"] . "K_Unit.php");
|
|
require_once($path["entity"] . "K_Unit.php");
|
|
|
|
|
+ require_once($path["entity"] . "Team.php");
|
|
|
require_once($path["entity"] . "Rune.php");
|
|
require_once($path["entity"] . "Rune.php");
|
|
|
|
|
|
|
|
|
|
|
|
@@ -182,6 +183,11 @@
|
|
|
*/
|
|
*/
|
|
|
public $rune = [];
|
|
public $rune = [];
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The {@see Teams}s the unit is on.
|
|
|
|
|
+ */
|
|
|
|
|
+ public $teams = [];
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Array with the levels of the skills.
|
|
* Array with the levels of the skills.
|
|
|
*/
|
|
*/
|
|
@@ -284,6 +290,7 @@
|
|
|
#$this->notes = $r["notes"];
|
|
#$this->notes = $r["notes"];
|
|
|
if ($complete){
|
|
if ($complete){
|
|
|
$this->load_runes();
|
|
$this->load_runes();
|
|
|
|
|
+ $this->load_teams();
|
|
|
$s =
|
|
$s =
|
|
|
"SELECT level " .
|
|
"SELECT level " .
|
|
|
"FROM " .
|
|
"FROM " .
|
|
@@ -316,6 +323,28 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Loads the teams array, with the @{Team}s the unit is on.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function load_teams(){
|
|
|
|
|
+ global $UID;
|
|
|
|
|
+ $this->teams = [];
|
|
|
|
|
+ $s = "
|
|
|
|
|
+ SELECT DISTINCT team.id AS id
|
|
|
|
|
+ FROM
|
|
|
|
|
+ team,
|
|
|
|
|
+ team_unit
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ team.uid = '$UID' AND
|
|
|
|
|
+ team.id = team_unit.team AND
|
|
|
|
|
+ team_unit.unit = '" . $this->id . "';
|
|
|
|
|
+ ";
|
|
|
|
|
+ $q = $this->db->query($s);
|
|
|
|
|
+ while ($r = $q->fetchArray(SQLITE3_ASSOC)){
|
|
|
|
|
+ array_push($this->teams, new Team($this->db, $r["id"], false));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Loads the information about the equiped runes.
|
|
* Loads the information about the equiped runes.
|
|
|
* It is autoatically called at construction time if the
|
|
* It is autoatically called at construction time if the
|