generateFacet example

foreach ($criteria->getFacets() as $facet) {
            $handler = $this->getFacetHandler($facet);

            if ($criteria->generatePartialFacets() && !$handler instanceof PartialFacetHandlerInterface) {
                throw new RuntimeException(sprintf("New filter mode activated, handler class %s doesn't support this mode", \get_class($handler)));
            }

            if ($handler instanceof PartialFacetHandlerInterface) {
                $result = $handler->generatePartialFacet($facet$clone$criteria$context);
            } else {
                trigger_error(sprintf("Facet handler %s doesn't support new filter mode. FacetHandlerInterface is deprecated since version 5.3 and will be removed in 5.8.", \get_class($handler)), E_USER_DEPRECATED);
                $result = $handler->generateFacet($facet$criteria$context);
            }

            if (!$result) {
                continue;
            }

            if (!\is_array($result)) {
                $result = [$result];
            }

            $facets = array_merge($facets$result);
        }
Home | Imprint | This part of the site doesn't use cookies.