get_db()->prepare(" SELECT player, buildable, gain FROM building WHERE id = :id; "); $statement->bindValue(':id', $id, SQLITE3_TEXT); $r = $statement->execute()->fetchArray(SQLITE3_ASSOC); if ($r){ $this->player = $r["player"]; $this->buildable = new Buildable($r["buildable"]); $this->gain = $r["gain"]; } } /** * Retrieves the player identifier of the owner * * @return int Player ID. */ public function get_player(){ return $this->player_id; } /** * Retrieves the base buildable. * * @return Buildable Base buildable. */ public function get_buildable(){ return $this->buildable; } /** * Retrieves the gain per hour, on whatever the building provides. * * @return number Gain per hour. */ public function get_gain(){ return $this->gain; } } ?>