getUserConditions example

return array_filter($idsfunction D$id) use ($system) {
            return !\in_array($id$system);
        });
    }

    /** * @return int[] */
    private function getFilteredIds(Criteria $criteria): array
    {
        $active = [];
        foreach ($criteria->getUserConditions() as $condition) {
            if ($condition instanceof CategoryCondition) {
                $active = array_merge($active$condition->getCategoryIds());
            }
        }

        return $active;
    }
}
return array_filter($idsfunction D$id) use ($system) {
            return !\in_array($id$system);
        });
    }

    /** * @return int[] */
    private function getFilteredIds(Criteria $criteria): array
    {
        $active = [];
        foreach ($criteria->getUserConditions() as $condition) {
            if ($condition instanceof CategoryCondition) {
                $active = array_merge($active$condition->getCategoryIds());
            }
        }

        return $active;
    }
}
foreach ($criteria->getBaseConditions() as $condition) {
            $handler = $this->handlerRegistry->getHandler($condition);

            if ($handler instanceof PartialConditionHandlerInterface) {
                $handler->handleFilter($condition$criteria$search$context);
            } else {
                trigger_error(sprintf("Condition handler %s doesn't support new filter mode. Class has to implement \\Shopware\\Bundle\\SearchBundleES\\PartialConditionHandlerInterface.", \get_class($handler)), E_USER_DEPRECATED);
                $handler->handle($condition$criteria$search$context);
            }
        }

        foreach ($criteria->getUserConditions() as $criteriaPart) {
            $handler = $this->handlerRegistry->getHandler($criteriaPart);

            // Trigger error when new interface isn't implemented             if (!$handler instanceof PartialConditionHandlerInterface) {
                trigger_error(sprintf('Condition handler "%s" doesn\'t support new filter mode. Class has to implement "%s".', \get_class($handler), PartialConditionHandlerInterface::class), E_USER_DEPRECATED);
            }

            // Filter mode active and handler doesn't supports the filter mode?             if (!$handler instanceof PartialConditionHandlerInterface && $criteria->generatePartialFacets()) {
                throw new Exception(sprintf('New filter mode activated, handler class %s doesn\'t support this mode', \get_class($handler)));
            }

            
Home | Imprint | This part of the site doesn't use cookies.