* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ declare(strict_types=1); namespace PrestaShop\PrestaShop\Adapter\Product\FeatureValue\CommandHandler; use PrestaShop\PrestaShop\Adapter\Product\FeatureValue\Update\ProductFeatureValueUpdater; use PrestaShop\PrestaShop\Core\Domain\Product\FeatureValue\Command\RemoveAllFeatureValuesFromProductCommand; use PrestaShop\PrestaShop\Core\Domain\Product\FeatureValue\CommandHandler\RemoveAllFeatureValuesFromProductHandlerInterface; /** * Handles @see RemoveAllFeatureValuesFromProductCommand using legacy object model */ class RemoveAllFeatureValuesFromProductHandler implements RemoveAllFeatureValuesFromProductHandlerInterface { /** * @var ProductFeatureValueUpdater */ private $productFeatureValueUpdater; public function __construct(ProductFeatureValueUpdater $productFeatureValueUpdater) { $this->productFeatureValueUpdater = $productFeatureValueUpdater; } /** * {@inheritDoc} */ public function handle(RemoveAllFeatureValuesFromProductCommand $command): void { $this->productFeatureValueUpdater->setFeatureValues($command->getProductId(), []); } }