get_db()->prepare(" SELECT id, name, description, farmable FROM source WHERE id = :id; "); $statement->bindValue(':id', $id, SQLITE3_TEXT); $r = $statement->execute()->fetchArray(SQLITE3_ASSOC); if ($r){ $this->id = $r["id"]; $this->name = HTML::e($r["name"]); $this->description = HTML::e($r["description"]); $this->farmable_source = $r["farmable"]; } } /** * Retrieves the source identifier. * * @return number Source ID. */ public function get_id(){ return $this->id; } /** * Retrieves the source name. * * @return string Source name. */ public function get_name(){ return $this->name; } /** * Retrieves the source description. * * @return string Source description. */ public function get_description(){ return $this->description; } /** * Checks if the osurce is farmable. * * @return boolean True if the source is farmable, false otherwise. */ public function is_farmable(){ return $this->farmable; } /** * Gets the path to the source image. * * @return string Image URL, or a fixed unknown image. */ public function get_image(){ return APPLICATION::img("SOURCE", $this->id); } } ?>