moduleDataSetup = $moduleDataSetup; $this->categorySetupFactory = $categorySetupFactory; } /** * {@inheritdoc} */ public function apply() { $this->moduleDataSetup->getConnection()->startSetup(); /** @var \Magento\Catalog\Setup\CategorySetup $categorySetup */ $categorySetup = $this->categorySetupFactory->create(['setup' => $this->moduleDataSetup]); $entityTypeId = $categorySetup->getEntityTypeId(Product::ENTITY); $attribute = $categorySetup->getAttribute($entityTypeId, 'gift_message_available'); $categorySetup->updateAttribute( $entityTypeId, $attribute['attribute_id'], 'source_model', \Magento\Catalog\Model\Product\Attribute\Source\Boolean::class ); $this->moduleDataSetup->getConnection()->endSetup(); } /** * {@inheritdoc} */ public static function getDependencies() { return [ MoveGiftMessageToGiftOptionsGroup::class ]; } /** * {@inheritdoc} */ public static function getVersion() { return '2.1.0'; } /** * {@inheritdoc} */ public function getAliases() { return []; } }