14
14
use Magento \Eav \Setup \EavSetupFactory ;
15
15
16
16
/**
17
- * Class ApplyAttributesUpdate
18
- * @package Magento\Bundle\Setup\Patch
17
+ * Class \Magento\Bundle\Setup\Patch\ApplyAttributesUpdate
19
18
*/
20
19
class ApplyAttributesUpdate implements DataPatchInterface, PatchVersionInterface
21
20
{
@@ -44,7 +43,7 @@ public function __construct(
44
43
}
45
44
46
45
/**
47
- * { @inheritdoc}
46
+ * @inheritdoc
48
47
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
49
48
*/
50
49
public function apply ()
@@ -66,8 +65,8 @@ public function apply()
66
65
', ' ,
67
66
$ eavSetup ->getAttribute (\Magento \Catalog \Model \Product::ENTITY , $ field , 'apply_to ' )
68
67
);
69
- if (!in_array (' bundle ' , $ applyTo )) {
70
- $ applyTo [] = ' bundle ' ;
68
+ if (!in_array (\ Magento \ Catalog \ Model \ Product \Type:: TYPE_BUNDLE , $ applyTo )) {
69
+ $ applyTo [] = \ Magento \ Catalog \ Model \ Product \Type:: TYPE_BUNDLE ;
71
70
$ eavSetup ->updateAttribute (
72
71
\Magento \Catalog \Model \Product::ENTITY ,
73
72
$ field ,
@@ -78,7 +77,7 @@ public function apply()
78
77
}
79
78
80
79
$ applyTo = explode (', ' , $ eavSetup ->getAttribute (\Magento \Catalog \Model \Product::ENTITY , 'cost ' , 'apply_to ' ));
81
- unset($ applyTo [array_search (' bundle ' , $ applyTo )]);
80
+ unset($ applyTo [array_search (\ Magento \ Catalog \ Model \ Product \Type:: TYPE_BUNDLE , $ applyTo )]);
82
81
$ eavSetup ->updateAttribute (\Magento \Catalog \Model \Product::ENTITY , 'cost ' , 'apply_to ' , implode (', ' , $ applyTo ));
83
82
84
83
/**
@@ -106,7 +105,7 @@ public function apply()
106
105
'visible_on_front ' => false ,
107
106
'used_in_product_listing ' => true ,
108
107
'unique ' => false ,
109
- 'apply_to ' => ' bundle '
108
+ 'apply_to ' => \ Magento \ Catalog \ Model \ Product \Type:: TYPE_BUNDLE
110
109
]
111
110
);
112
111
@@ -131,7 +130,7 @@ public function apply()
131
130
'comparable ' => false ,
132
131
'visible_on_front ' => false ,
133
132
'unique ' => false ,
134
- 'apply_to ' => ' bundle '
133
+ 'apply_to ' => \ Magento \ Catalog \ Model \ Product \Type:: TYPE_BUNDLE
135
134
]
136
135
);
137
136
@@ -157,7 +156,7 @@ public function apply()
157
156
'visible_on_front ' => false ,
158
157
'used_in_product_listing ' => true ,
159
158
'unique ' => false ,
160
- 'apply_to ' => ' bundle '
159
+ 'apply_to ' => \ Magento \ Catalog \ Model \ Product \Type:: TYPE_BUNDLE
161
160
]
162
161
);
163
162
@@ -184,7 +183,7 @@ public function apply()
184
183
'visible_on_front ' => false ,
185
184
'used_in_product_listing ' => true ,
186
185
'unique ' => false ,
187
- 'apply_to ' => ' bundle '
186
+ 'apply_to ' => \ Magento \ Catalog \ Model \ Product \Type:: TYPE_BUNDLE
188
187
]
189
188
);
190
189
@@ -210,29 +209,29 @@ public function apply()
210
209
'visible_on_front ' => false ,
211
210
'used_in_product_listing ' => true ,
212
211
'unique ' => false ,
213
- 'apply_to ' => ' bundle '
212
+ 'apply_to ' => \ Magento \ Catalog \ Model \ Product \Type:: TYPE_BUNDLE
214
213
]
215
214
);
216
215
}
217
216
218
217
/**
219
- * { @inheritdoc}
218
+ * @inheritdoc
220
219
*/
221
220
public static function getDependencies ()
222
221
{
223
222
return [];
224
223
}
225
224
226
225
/**
227
- * { @inheritdoc}
226
+ * @inheritdoc
228
227
*/
229
228
public static function getVersion ()
230
229
{
231
230
return '2.0.0 ' ;
232
231
}
233
232
234
233
/**
235
- * { @inheritdoc}
234
+ * @inheritdoc
236
235
*/
237
236
public function getAliases ()
238
237
{
0 commit comments