code: public function setFilterParameters($filterId, $presets, $values)
      {
          $filterSettings = $this->getFilterSettings($filterId);
          $presetNames    = $filterSettings->getParameters();
          $feFilterParams = array_keys($filterSettings->getParameterFilterNames());
          $processed      = array();
  
          // We have to use all the preset values we want first.
          foreach ($presets as $strPresetName => $arrPreset) {
              if (in_array($strPresetName, $presetNames)) {
                  $processed[$strPresetName] = $arrPreset['value'];
              }
          }
  
          // Now we have to use all FE filter params, that are either:
          // * not contained within the presets
          // * or are overridable.
          foreach ($feFilterParams as $strParameter) {
              // Unknown parameter? - next please.
              if (!array_key_exists($strParameter, $values)) {
                  continue;
              }
              // Not a preset or allowed to override? - use value.
              if ((!array_key_exists($strParameter, $presets)) || $presets[$strParameter]['use_get']) {
                  $processed[$strParameter] = $values[$strParameter];
              }
          }
  
          return $processed;
      }
docs: Set parameters.
  
  @param string   $filterId The id of the filter.
  
  @param string[] $presets  The parameter preset values to use.
  
  @param string[] $values   The dynamic parameter values that may be used.
  
  @return array