get_db()->prepare(" SELECT stat, value FROM artifact_stat WHERE artifact = :artifact "); $statement->bindValue(':artifact', $artifact_id, SQLITE3_TEXT); $r = $statement->execute()->fetchArray(SQLITE3_ASSOC); if ($r){ $this->stat = $r["stat"]; $this->value = $r["value"]; switch ($this->stat){ case ARTIFACT_STAT_ID::HP: $this->name = "HP"; break; case ARTIFACT_STAT_ID::ATK: $this->name = "ATK"; break; case ARTIFACT_STAT_ID::DEF: $this->name = "DEF"; break; } } } /** * Retrieves the artifact stat identifier. * * @see ARTIFACT_STAT_ID * * @return int Artifact stat ID. */ public function get_stat(){ return $this->stat; } /** * Retrieves the artifact stat name. * * @return string Artifact stat name. */ public function get_name(){ return $this->name; } /** * Retrieves the value of the artifact stat value. * * @return number Stat value. */ public function get_value(){ return $this->value; } } ?>