ruleset = new Ruleset(strict: true); $this->ruleset->GET([ (new Rules(ConfigModel::REF_MB_ID->value)) ->type(Type::STRING) ->min(parent::UUID_LENGTH) ->max(parent::UUID_LENGTH), (new Rules(ConfigModel::FRIENDLY_NAME->value)) ->type(Type::STRING) ->min(1) ->max(parent::MYSQL_VARCHAR_MAX_LENGTH) ]); parent::__construct(Databases::BATTLESTATION, $this->ruleset); // Use a copy of search parameters $this->query = $_GET; } private function get_config(): array { return $this->results = $this->db ->for(ConfigModel::TABLE) ->where($this->query) ->order([ConfigModel::DATE_BUILT->value => "DESC"]) ->select(ConfigModel::values()) ->fetch_all(MYSQLI_ASSOC); } public function main(): Response { // Set properties as "searchable" parent::make_wildcard_search(ConfigModel::FRIENDLY_NAME->value, $this->query); $this->get_config(); // Return 404 Not Found if response array is empty return new Response($this->results, $this->results ? 200 : 404); } }