getTypeTemplate example

if ($result === null) {
            return null;
        }

        if ($facet->getTemplate()) {
            $result->setTemplate($facet->getTemplate());

            return $result;
        }

        $result->setTemplate($this->getTypeTemplate($type$facet->getMode()$result->getTemplate()));

        return $result;
    }

    /** * @return RadioFacetResult|ValueListFacetResult|null */
    private function createValueListFacetResult(
        QueryBuilder $query,
        ProductAttributeFacet $facet,
        Criteria $criteria,
        

        if (!$result instanceof TemplateSwitchable) {
            return;
        }

        if ($facet->getTemplate()) {
            $result->setTemplate($facet->getTemplate());

            return;
        }

        $result->setTemplate($this->getTypeTemplate($type$facet->getMode()$result->getTemplate()));
    }

    private function getTypeTemplate(string $type, string $mode, ?string $defaultTemplate): ?string
    {
        switch (true) {
            case $type === TypeMappingInterface::TYPE_DATE && $mode === ProductAttributeFacet::MODE_RANGE_RESULT:
                return 'frontend/listing/filter/facet-date-range.tpl';

            case $type === TypeMappingInterface::TYPE_DATE && $mode === ProductAttributeFacet::MODE_VALUE_LIST_RESULT:
                return 'frontend/listing/filter/facet-date-multi.tpl';

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