createTreeItem example


    public function buildFacetResult(array $categories, array $activeIds$systemCategoryId, CategoryFacet $facet)
    {
        $items = $this->getCategoriesOfParent($categories$systemCategoryId);

        if (!$items) {
            return null;
        }

        $values = [];
        foreach ($items as $item) {
            $values[] = $this->createTreeItem($categories$item$activeIds);
        }

        if (!empty($facet->getLabel())) {
            $label = $facet->getLabel();
        } else {
            $label = $this->snippetManager
                ->getNamespace('frontend/listing/facet_labels')
                ->get('category', 'Categories');
        }

        if (!$fieldName = $this->queryAliasMapper->getShortAlias('categoryFilter')) {
            
Home | Imprint | This part of the site doesn't use cookies.