public static function save_filter_values_from_form(tour $tour, \stdClass $data) {
        $filtername = static::get_filter_name();

        $key = "filter_{$filtername}";

        $newvalue = $data->$key;
        foreach ($data->$key as $value) {
            if ($value === static::ANYVALUE) {
                $newvalue = [];
                break;
            }
        }

        $tour->set_filter_values($filtername, $newvalue);
    }
public static function save_filter_values_from_form(tour $tour, \stdClass $data) {
        $filtername = static::get_filter_name();

        $key = "filter_{$filtername}";

        $newvalue = $data->$key;
        foreach ($data->$key as $value) {
            if ($value === static::ANYVALUE) {
                $newvalue = [];
                break;
            }
        }

        $tour->set_filter_values($filtername, $newvalue);
    }
public static function save_filter_values_from_form ( tour $ tour , \ stdClass $ data ) { $ filtername = static :: get_filter_name ( ) ; $ key = "filter_{$filtername}" ; $ newvalue = $ data -> $ key ; foreach ( $ data -> $ key as $ value ) { if ( $ value === static :: ANYVALUE ) { $ newvalue = [ ] ; break ; } } $ tour -> set_filter_values ( $ filtername , $ newvalue ) ; }
Save the filter values from the form to the tour.

@param   tour            $tour       The tour to save values to
@param   stdClass        $data       The data submitted in the form
Save the filter values from the form to the tour .