null, "member" => null ]; /** * Number of days included in the offer. */ public $days; /** * Constructor. * * Searches the database and retrieves the information about the * entity, populating it and it's items. * * @param db Connection to the database. * @param lang Lowercase, two-letter language code. * @param id Identifier. */ public function __construct($db, $lang, $id){ parent::__construct($db, null); $s = "SELECT " . " id, " . " year, " . " name_$lang AS name, " . " description_$lang AS description, " . " price, " . " price_public, " . " days " . "FROM festival_offer " . "WHERE id = $id;"; $q = mysqli_query($this->db, $s); if (mysqli_num_rows($q) > 0){ $r = mysqli_fetch_array($q); $this->id = $r["id"]; $this->year = $r["year"]; $this->name = $r["name"]; $this->description = $r["description"]; $this->price->member = $r["price"]; $this->price->public = $r["price_public"]; $this->days = $r["days"]; } } } ?>