get_db()->prepare($s); $statement->bindValue(':id', $id, SQLITE3_TEXT); $statement->bindValue(':type', $type, SQLITE3_TEXT); $r = $statement->execute()->fetchArray(SQLITE3_ASSOC); if ($r){ $this->type = $r["type"]; $this->id = $r["id"]; $this->name = HTML::e($r["name"]); $this->description = HTML::e($r["description"]); } } /** * Retrieves the owned item identifier. * * @return int Item ID. */ public function get_id(){ return $this->id; } /** * Retrieves the item name. * * @return string Item name. */ public function get_name(){ return $this->name; } /** * Retrieves the item type. * * @return int Item type. */ public function get_type(){ return $this->type; } /** * Retrieves the item description. * * @return string Item description. */ public function get_description(){ return $this->description; } /** * Gets the path to the item image. * * @return string Image URL, or a fixed unknown image. */ public function get_image(){ return APPLICATION::img("INVENTORY", $this->id); } } ?>