updates filter paramateres in session
551110
public function update()
    {
        $inputs = Input::all();
        $s      = $this->request->session();
        $route  = uri();

        $session = $s->get($route, []);
        if (empty($session)) {
            return false;
        }
        if (is_null($column = array_get($inputs, 'column'))) {
            return false;
        }
        if (!isset($session[$column]['values'])) {
            return false;
        }

        $old        = !is_null($serialized = array_get($inputs, 'serialized')) ? unserialize($serialized) : array_get($inputs, 'old');
        $new        = array_get($inputs, 'new');
        $index      = array_search($old, $session[$column]['values']);
        if ($index !== false) {
            unset($session[$column]['values'][$index]);
        }
        $session[$column]['values'][] = $new;

        $sidebars = $this->adapter->getDeleteSidebarItem($column, $session[$column], $new);
        if (!empty($sidebars)) {
            $s->put($route, [$column => $session[$column]]);
            $s->save();
            return response(implode('', $sidebars), 200);
        }
    }
26547
public function filter( $filter, $params )
    {
        $argList = func_get_args( );

        array_shift( $argList );

        if ( isset( $this->filters[ $filter ] ) )
        {
            foreach( $this->filters[ $filter ] as $callback )
            {
                $argList[ 0 ] = call_user_func_array( $callback[ 'callback' ], $argList );

                if ( $this->debug )
                {
                    echo PHP_EOL . '->FILTER: ' . $filter . ' -> '
                            . $this->_serializeCallback( $callback[ 'callback' ] )
                            . ' + Priority: ' . $callback[ 'priority' ]
                            . PHP_EOL;
                }
            }
        }

        return $argList[ 0 ];
    }
513587
public function executefilter()
    {
        $baseLanguageId = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
        // store this into session
        $attributeFilter = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('attrfilter', true);
        $activeCategory = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('cnid');

        if (!empty($attributeFilter)) {
            $sessionFilter = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('session_attrfilter');
            //fix for #2904 - if language will be changed attributes of this category will be deleted from session
            //and new filters for active language set.
            $sessionFilter[$activeCategory] = null;
            $sessionFilter[$activeCategory][$baseLanguageId] = $attributeFilter;
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('session_attrfilter', $sessionFilter);
        }
    }
107591
private function applyFilters()
    {
        // Manage filters
        // Filter values come either from the form (GET)
        // Or from session
        $form = $this->getFiltersForm();

        if (!$form) {
            // No filters are configured for this admin
            return;
        }

        $this->loadFilterValues();
        // Init form with current data if any
        $form->setData($this->filterValues);

        $form->handleRequest($this->request);

        if ($form->isSubmitted()) {

            if ($form->get('reset')->isClicked()) {
                // Submitted for reset
                // Reset stored content
                $this->clearFilterValues();
                // Reset displayed values by rebuilding the form
                // yes, it's a pity we cannot simply change content of it
                $this->getFiltersForm(true);
            }
            else {
                // Submitted for filtering
                // Overwrite any stored values with the submitted ones
                // Update storage for subsequent requests
                $this->storeFilterValues($form->getData());
            }
        }

        // Map values, if any, to filters
        if (is_array($this->filterValues)) {
            foreach ($this->filters as $filter) {
                if (array_key_exists($filter->getName(), $this->filterValues)) {
                    $filter->setValue($this->filterValues[$filter->getName()]);
                }
            }
        }
    }
520432
private function setFilterParameters($name, SQLFilter $filter)
    {
        if (empty($this->filtersParameters[$name])) {
            return;
        }

        $parameters = $this->filtersParameters[$name];
        foreach ($parameters as $paramName => $paramValue) {
            $filter->setParameter($paramName, $paramValue);
        }
    }
861403
function (sid, session, callback) {
        var rec = {};

        // apply our properties:
        _applyProp(propSid, sid, rec);
        _applyProp(propData, serializer(session), rec);

        // opportunity to do:
        _applyProp(propLastActive, new Date(), rec);

        mongooseModel.findOneAndUpdate(_applyProp(propSid, sid), rec, {upsert: true}, function(err){
          (callback||_.noop)(err);
        });
      }
65966
protected function updateFilters()
    {
        $request = request();

        if ($request->filled('_clear')) {
            $this->filters = [];
            $resetPage = ! empty($this->filters);
        } else {
            $this->filters = $request->get('filter', []);
            $resetPage = true;
        }

        $this->storeFiltersInSession();

        if ($resetPage) {
            $this->markResetActivePage();
        }

        return $this;
    }
708861
def handle_server_filter(self, request, table=None):
        
        if not table:
            table = self.get_table()
        filter_info = self.get_server_filter_info(request, table)
        if filter_info is None:
            return False
        request.session[filter_info['value_param']] = filter_info['value']
        if filter_info['field_param']:
            request.session[filter_info['field_param']] = filter_info['field']
        return filter_info['changed']
1166911
protected function _setSessionParams()
    {
        // reset it from session
        \OxidEsales\Eshop\Core\Registry::getSession()->deleteVariable("sExportDelCost");
        $dDelCost = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sExportDelCost");
        if (isset($dDelCost)) {
            $dDelCost = str_replace([";", " ", "/", "'"], "", $dDelCost);
            $dDelCost = str_replace(",", ".", $dDelCost);
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("sExportDelCost", $dDelCost);
        }

        \OxidEsales\Eshop\Core\Registry::getSession()->deleteVariable("sExportMinPrice");
        $dMinPrice = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sExportMinPrice");
        if (isset($dMinPrice)) {
            $dMinPrice = str_replace([";", " ", "/", "'"], "", $dMinPrice);
            $dMinPrice = str_replace(",", ".", $dMinPrice);
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("sExportMinPrice", $dMinPrice);
        }

        // #827
        \OxidEsales\Eshop\Core\Registry::getSession()->deleteVariable("sExportCampaign");
        $sCampaign = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sExportCampaign");
        if (isset($sCampaign)) {
            $sCampaign = str_replace([";", " ", "/", "'"], "", $sCampaign);
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("sExportCampaign", $sCampaign);
        }

        // reset it from session
        \OxidEsales\Eshop\Core\Registry::getSession()->deleteVariable("blAppendCatToCampaign");
        // now retrieve it from get or post.
        $blAppendCatToCampaign = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("blAppendCatToCampaign");
        if ($blAppendCatToCampaign) {
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("blAppendCatToCampaign", $blAppendCatToCampaign);
        }

        // reset it from session
        \OxidEsales\Eshop\Core\Registry::getSession()->deleteVariable("iExportLanguage");
        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("iExportLanguage", \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("iExportLanguage"));

        //setting the custom header
        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("sExportCustomHeader", \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sExportCustomHeader"));
    }
1253986
function updateQueryStringParameter(uri, key, value) {
            var re = new RegExp("([?|&])" + key + "=.*?(&|#|$)", "i");

            if (uri.match(re)) {
                return uri.replace(re, '$1' + key + "=" + value + '$2');
            } else {
                var hash = '';

                if (uri.indexOf('#') !== -1) {
                    hash = uri.replace(/.*#/, '#');
                    uri = uri.replace(/#.*/, '');
                }

                var separator = uri.indexOf('?') !== -1 ? "&" : "?";
                return uri + separator + key + "=" + value + hash;
            }
        }
710699
def Filter(self, match=None, **_):
    """"""
    arg = self.stack.pop(-1)

    # Filters can be specified as a comma separated list.
    for filter_name in match.group(1).split(","):
      filter_object = ConfigFilter.classes_by_name.get(filter_name)
      if filter_object is None:
        raise FilterError("Unknown filter function %r" % filter_name)

      if not filter_object.sensitive_arg:
        logging.debug("Applying filter %s for %s.", filter_name, arg)
      arg = filter_object().Filter(arg)
      precondition.AssertType(arg, Text)

    self.stack[-1] += arg
917860
private function applyDataTableFilters()
    {
        $filters = $this->request->getFilters();

        foreach ($filters as $fieldName => $filterValue) {
            if (empty($filterValue)) {
                continue;
            }

            if (is_array($filterValue)) {
                $this->taskLogFilter->in($fieldName, $filterValue);
                continue;
            }

            $this->taskLogFilter->eq($fieldName, (string) $filterValue);
        }
    }
30145
protected function UpdateWishlist()
    {
        $aInput = $this->global->GetUserData(TdbPkgShopWishlist::URL_PARAMETER_FILTER_DATA);
        $sWishListDescription = '';
        if (array_key_exists('description', $aInput)) {
            $sWishListDescription = $aInput['description'];
        }
        $oMsgManager = TCMSMessageManager::GetInstance();

        $oUser = TdbDataExtranetUser::GetInstance();
        if ($oUser->IsLoggedIn()) {
            $oWishlist = &$oUser->GetWishlist(true);
            $aTmp = $oWishlist->sqlData;
            $aTmp['description'] = $sWishListDescription;
            if (array_key_exists('is_public', $aInput)) {
                $aTmp['is_public'] = $aInput['is_public'];
            }

            $oWishlist->LoadFromRow($aTmp);
            $oWishlist->Save();

            $aItems = array();
            if (array_key_exists('aItem', $aInput) && is_array($aInput['aItem'])) {
                $aItems = $aInput['aItem'];
                foreach ($aItems as $sWishlistItemId => $aItemData) {
                    $oWishlistItem = TdbPkgShopWishlistArticle::GetNewInstance();
                    /** @var $oWishlistItem TdbPkgShopWishlistArticle */
                    if ($oWishlistItem->LoadFromFields(array('pkg_shop_wishlist_id' => $oWishlist->id, 'id' => $sWishlistItemId))) {
                        $atmpData = $oWishlistItem->sqlData;
                        if (array_key_exists('comment', $aItemData)) {
                            $atmpData['comment'] = $aItemData['comment'];
                        }
                        if (array_key_exists('amount', $aItemData)) {
                            $atmpData['amount'] = $aItemData['amount'];
                        }
                        $oWishlistItem->LoadFromRow($atmpData);
                        $oWishlistItem->AllowEditByAll(true);
                        $oWishlistItem->Save();
                    }
                }
            }

            $oMsgManager->AddMessage($oWishlist->GetMsgConsumerName(), 'WISHLIST-UPDATED-INFOS');
        }
    }
895946
def update_with(self, **query):
        
        for k, v in self._filter_attrs(query).items():
            setattr(self, k, v)
        return self.save()
1311155
def apply_filters(query, args):
    
    pre_joins = []
    for querystring_key, filter_value in args.items(multi=True):
        if querystring_key in filter_registry:
            cls_inst = filter_registry[querystring_key]
            query = cls_inst.apply_filter(query, args, pre_joins)
        elif querystring_key in PaginationKeys._value_list:
            pass
        else:
            raise InvalidQueryString(querystring_key, filter_value)
    return query
977879
protected function putRetainedFilterValuesInSession()
    {
        collect($this->filterHandlers)
            // Only filters sent which are declared "retained"
            ->filter(function($handler, $attribute) {
                return request()->has("filter_$attribute")
                    && $this->isRetainedFilter($handler, $attribute);
            })
            ->each(function($handler, $attribute) {
                // Array case: we store a coma separated string
                // (to be consistent and only store strings on filter session)
                $value = is_array(request()->get("filter_$attribute"))
                    ? implode(",", request()->get("filter_$attribute"))
                    : request()->get("filter_$attribute");

                if(strlen(trim($value)) === 0) {
                    // No value, we have to unset the retained value
                    session()->forget("_sharp_retained_filter_$attribute");

                } else {
                    session()->put(
                        "_sharp_retained_filter_$attribute",
                        $value
                    );
                }
            });

        session()->save();
    }
1056468
private void onTypedParameter(FilterClause filterClause) {

        if (filterClause.value != null && filterClause.value.get(0) == null) {
            return;
        }

        if (filterClause.value != null && filterClause.value.get(0).toString().startsWith(":")) {
            addTypedParameter(Type.NAMED, filterClause.value.get(0).toString(), filterClause);
            filterJPAParameterInfo(Type.NAMED, filterClause.value.get(0).toString().substring(1),
                filterClause.fieldName);
        } else if (filterClause.value.toString() != null && filterClause.value.get(0).toString().startsWith("?")) {
            addTypedParameter(Type.INDEXED, filterClause.value.get(0).toString(), filterClause);
            filterJPAParameterInfo(Type.INDEXED, filterClause.value.get(0).toString().substring(1),
                filterClause.fieldName);
        }
    }