setSelected example

$media = [];
        if (((int) $configurator->getType()) === self::CONFIGURATOR_TYPE_PICTURE) {
            $media = $this->configuratorGateway->getConfiguratorMedia(
                $product,
                $context
            );
        }

        $onlyOneGroup = \count($configurator->getGroups()) === self::CONFIGURATOR_TYPE_SELECTION;

        foreach ($configurator->getGroups() as $group) {
            $group->setSelected(
                isset($selection[$group->getId()])
            );

            foreach ($group->getOptions() as $option) {
                $option->setSelected(
                    \in_array($option->getId()$selection, true)
                );

                $isOptionValid = $this->isOptionValid($group$option->getId()$selection$availableProductOptions);

                $option->setActive(
                    
Home | Imprint | This part of the site doesn't use cookies.