src/FilterSetting/Tags.php
public function prepareRules(IFilter $objFilter, $arrFilterUrl)
    {
        $objMetaModel = $this->getMetaModel();
        $objAttribute = $objMetaModel->getAttributeById($this->get('attr_id'));
        $strParamName = $this->getParamName();

        $arrParamValue = $this->buildParamValue($arrFilterUrl, $strParamName);
        $arrOptions    = $this->getParameterFilterOptions($objAttribute, null);
        $arrParamValue = $this->filterParamValue($arrParamValue, $arrOptions);

        if ($objAttribute && $strParamName && is_array($arrParamValue) && $arrOptions) {
            // Determine which parenting rule to use, AND or OR.
            if ($this->get('useor')) {
                $objParentRule = new ConditionOr();
            } else {
                $objParentRule = new ConditionAnd();
            }

            // We allow the current and the fallback language to be searched by default.
            $arrValidLanguages = array(
                $this->getMetaModel()->getActiveLanguage(),
                $this->getMetaModel()->getFallbackLanguage()
            );

            foreach ($arrParamValue as $strParamValue) {
                // Restrict to valid options for obvious reasons.
                if (array_key_exists($strParamValue, $arrOptions)) {
                    $objSubFilter = new Filter($objMetaModel);
                    $objSubFilter->addFilterRule(
                        new SearchAttribute($objAttribute, $strParamValue, $arrValidLanguages)
                    );

                    $objParentRule->addChild($objSubFilter);
                }
            }

            $objFilter->addFilterRule($objParentRule);

            return;
        }

        // If no setting has been defined, we appear transparently as "not defined" and return all items.
        $objFilter->addFilterRule(new StaticIdList(null));
    }
public function prepareRules(IFilter $objFilter, $arrFilterUrl)
    {
        $objMetaModel = $this->getMetaModel();
        $objAttribute = $objMetaModel->getAttributeById($this->get('attr_id'));
        $strParamName = $this->getParamName();

        $arrParamValue = $this->buildParamValue($arrFilterUrl, $strParamName);
        $arrOptions    = $this->getParameterFilterOptions($objAttribute, null);
        $arrParamValue = $this->filterParamValue($arrParamValue, $arrOptions);

        if ($objAttribute && $strParamName && is_array($arrParamValue) && $arrOptions) {
            // Determine which parenting rule to use, AND or OR.
            if ($this->get('useor')) {
                $objParentRule = new ConditionOr();
            } else {
                $objParentRule = new ConditionAnd();
            }

            // We allow the current and the fallback language to be searched by default.
            $arrValidLanguages = array(
                $this->getMetaModel()->getActiveLanguage(),
                $this->getMetaModel()->getFallbackLanguage()
            );

            foreach ($arrParamValue as $strParamValue) {
                // Restrict to valid options for obvious reasons.
                if (array_key_exists($strParamValue, $arrOptions)) {
                    $objSubFilter = new Filter($objMetaModel);
                    $objSubFilter->addFilterRule(
                        new SearchAttribute($objAttribute, $strParamValue, $arrValidLanguages)
                    );

                    $objParentRule->addChild($objSubFilter);
                }
            }

            $objFilter->addFilterRule($objParentRule);

            return;
        }

        // If no setting has been defined, we appear transparently as "not defined" and return all items.
        $objFilter->addFilterRule(new StaticIdList(null));
    }
{@inheritdoc}