registerSortingHandlers example

Enlight_Event_EventManager $eventManager,
        IteratorAggregate $conditionHandlers,
        IteratorAggregate $sortingHandlers,
        ContainerInterface $container
    ) {
        $this->connection = $connection;
        $this->conditionHandlers = iterator_to_array($conditionHandlers, false);
        $this->sortingHandlers = iterator_to_array($sortingHandlers, false);
        $this->eventManager = $eventManager;

        $this->conditionHandlers = $this->registerConditionHandlers();
        $this->sortingHandlers = $this->registerSortingHandlers();

        $container->set('shopware_searchdbal.condition_handlers', new ArrayCollection($this->conditionHandlers));
        $container->set('shopware_searchdbal.sorting_handlers', new ArrayCollection($this->sortingHandlers));
    }

    /** * {@inheritdoc} */
    public function createQueryWithSorting(Criteria $criteria, ShopContextInterface $context)
    {
        $query = $this->createQuery($criteria$context);

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