moduleDataSetup = $moduleDataSetup; $this->eavSetupFactory = $eavSetupFactory; } /** * {@inheritdoc} */ public function apply() { $this->moduleDataSetup->getConnection()->startSetup(); /** @var \Magento\Eav\Setup\EavSetup $eavSetup */ $eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]); $attributeSetId = $eavSetup->getDefaultAttributeSetId(Product::ENTITY); $groupId = (int)$eavSetup->getAttributeGroupByCode( Product::ENTITY, $attributeSetId, 'image-management', 'attribute_group_id' ); $eavSetup->addAttributeToGroup(Product::ENTITY, $attributeSetId, $groupId, 'swatch_image'); $this->moduleDataSetup->getConnection()->endSetup(); } /** * {@inheritdoc} */ public static function getDependencies() { return [ AddSwatchImageAttribute::class ]; } /** * {@inheritdoc} */ public static function getVersion() { return '2.0.1'; } /** * {@inheritdoc} */ public function getAliases() { return []; } }