3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+ declare (strict_types=1 );
6
7
7
8
namespace Magento \Catalog \Setup \Patch \Data ;
8
9
9
10
use Magento \Catalog \Setup \CategorySetup ;
10
11
use Magento \Catalog \Setup \CategorySetupFactory ;
11
- use Magento \Framework \App \ResourceConnection ;
12
12
use Magento \Framework \Setup \ModuleDataSetupInterface ;
13
13
use Magento \Framework \Setup \Patch \DataPatchInterface ;
14
14
use Magento \Framework \Setup \Patch \PatchVersionInterface ;
15
15
16
16
/**
17
17
* Class UpdateDefaultAttributeValue
18
- * @package Magento\Catalog\Setup\Patch
19
18
*/
20
19
class UpdateDefaultAttributeValue implements DataPatchInterface, PatchVersionInterface
21
20
{
@@ -30,7 +29,6 @@ class UpdateDefaultAttributeValue implements DataPatchInterface, PatchVersionInt
30
29
private $ categorySetupFactory ;
31
30
32
31
/**
33
- * PatchInitial constructor.
34
32
* @param ModuleDataSetupInterface $moduleDataSetup
35
33
* @param CategorySetupFactory $categorySetupFactory
36
34
*/
@@ -43,17 +41,22 @@ public function __construct(
43
41
}
44
42
45
43
/**
46
- * { @inheritdoc}
44
+ * @inheritdoc
47
45
*/
48
46
public function apply ()
49
47
{
50
48
/** @var CategorySetup $categorySetup */
51
49
$ categorySetup = $ this ->categorySetupFactory ->create (['setup ' => $ this ->moduleDataSetup ]);
52
- $ categorySetup ->updateAttribute (3 , 54 , 'default_value ' , 1 );
50
+ $ categorySetup ->updateAttribute (
51
+ CategorySetup::CATEGORY_ENTITY_TYPE_ID ,
52
+ 'is_anchor ' ,
53
+ 'default_value ' ,
54
+ 1
55
+ );
53
56
}
54
57
55
58
/**
56
- * { @inheritdoc}
59
+ * @inheritdoc
57
60
*/
58
61
public static function getDependencies ()
59
62
{
@@ -63,15 +66,15 @@ public static function getDependencies()
63
66
}
64
67
65
68
/**
66
- * { @inheritdoc}
69
+ * @inheritdoc
67
70
*/
68
71
public static function getVersion ()
69
72
{
70
73
return '2.0.3 ' ;
71
74
}
72
75
73
76
/**
74
- * { @inheritdoc}
77
+ * @inheritdoc
75
78
*/
76
79
public function getAliases ()
77
80
{
0 commit comments