11 use Magento\Eav\Setup\EavSetupFactory;
25 private $moduleDataSetup;
30 private $eavSetupFactory;
38 \
Magento\Framework\Setup\ModuleDataSetupInterface $moduleDataSetup,
39 EavSetupFactory $eavSetupFactory
41 $this->moduleDataSetup = $moduleDataSetup;
48 public function apply()
57 $this->moduleDataSetup->getConnection()->insertOnDuplicate(
58 $this->moduleDataSetup->getTable(
'catalog_product_link_type'),
65 $select = $this->moduleDataSetup->getConnection()
68 [
'c' => $this->moduleDataSetup->getTable(
'catalog_product_link_attribute')]
74 $result = $this->moduleDataSetup->getConnection()->fetchAll(
$select);
79 'product_link_attribute_code' =>
'position',
84 'product_link_attribute_code' =>
'qty',
85 'data_type' =>
'decimal' 88 $this->moduleDataSetup->getConnection()->insertMultiple(
89 $this->moduleDataSetup->getTable(
'catalog_product_link_attribute'),
94 $eavSetup = $this->eavSetupFactory->create([
'setup' => $this->moduleDataSetup]);
95 $field =
'country_of_manufacture';
97 if (!in_array(
'grouped', $applyTo)) {
98 $applyTo[] =
'grouped';
__construct(\Magento\Framework\Setup\ModuleDataSetupInterface $moduleDataSetup, EavSetupFactory $eavSetupFactory)