public static function save_filter_values_from_form(tour $tour, \stdClass $data) {
        $filtername = static::get_filter_name();
        $key = "filter_{$filtername}";
        $newvalue = $data->$key;
        if (empty($data->$key)) {
            $newvalue = [];
        }
        $tour->set_filter_values($filtername, $newvalue);
    }