setSortings example

$sorting->setId($id);
        $sorting->setDisplayInCategories((bool) $data['__customSorting_display_in_categories']);
        $sorting->setLabel($data['__customSorting_label']);
        $sorting->setPosition((int) $data['__customSorting_position']);

        /** @var array<SortingInterface> $sortings */
        $sortings = $this->reflector->unserialize(
            json_decode($data['__customSorting_sortings'], true),
            sprintf('Serialization error in custom sorting %s', $sorting->getLabel())
        );

        $sorting->setSortings($sortings);

        return $sorting;
    }

    /** * @return CustomFacet|null */
    public function hydrateFacet(array $data, array $streams)
    {
        $id = (int) $data['__customFacet_id'];
        $translation = $this->getTranslation($data, '__customFacet', []$id);
        
Home | Imprint | This part of the site doesn't use cookies.