public function load(string $activeId, SalesChannelContext $context): ?Tree
    {
        /** @var CategoryEntity $active */
        $active = $this->loadActive($activeId, $context);

        $criteria = new Criteria();
        $criteria->addFilter(new EqualsFilter('visible', true));

        /** @var CategoryCollection $categories */
        $categories = $this->categoryRepository->search($criteria, $context)->getEntities();
        $categories->sortByPosition();

        return $this->getTree($context->getSalesChannel()->getNavigationCategoryId(), $categories, $active);
    }
public function load(string $activeId, SalesChannelContext $context): ?Tree
    {
        /** @var CategoryEntity $active */
        $active = $this->loadActive($activeId, $context);

        $criteria = new Criteria();
        $criteria->addFilter(new EqualsFilter('visible', true));

        /** @var CategoryCollection $categories */
        $categories = $this->categoryRepository->search($criteria, $context)->getEntities();
        $categories->sortByPosition();

        return $this->getTree($context->getSalesChannel()->getNavigationCategoryId(), $categories, $active);
    }
public function load ( string $ activeId , SalesChannelContext $ context ) : ? Tree { /** @var CategoryEntity $active */ $ active = $ this -> loadActive ( $ activeId , $ context ) ; $ criteria = new Criteria ( ) ; $ criteria -> addFilter ( new EqualsFilter ( 'visible' , true ) ) ; /** @var CategoryCollection $categories */ $ categories = $ this -> categoryRepository -> search ( $ criteria , $ context ) -> getEntities ( ) ; $ categories -> sortByPosition ( ) ; return $ this -> getTree ( $ context -> getSalesChannel ( ) -> getNavigationCategoryId ( ) , $ categories , $ active ) ; }
Returns the full category tree. The provided active id will be marked as selected
Returns the full category tree . The provided active id will be marked as selected