Skip to content

Commit dbe38ea

Browse files
committed
Merge remote-tracking branch 'origin/MC-30398' into 2.4-develop-pr7
2 parents 16b0f4a + d7363ad commit dbe38ea

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

app/code/Magento/Catalog/Setup/Patch/Data/UpdateDefaultAttributeValue.php

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Catalog\Setup\Patch\Data;
89

910
use Magento\Catalog\Setup\CategorySetup;
1011
use Magento\Catalog\Setup\CategorySetupFactory;
11-
use Magento\Framework\App\ResourceConnection;
1212
use Magento\Framework\Setup\ModuleDataSetupInterface;
1313
use Magento\Framework\Setup\Patch\DataPatchInterface;
1414
use Magento\Framework\Setup\Patch\PatchVersionInterface;
1515

1616
/**
17-
* Class UpdateDefaultAttributeValue
18-
* @package Magento\Catalog\Setup\Patch
17+
* Updates 'is_anchor' attribute default value.
1918
*/
2019
class UpdateDefaultAttributeValue implements DataPatchInterface, PatchVersionInterface
2120
{
@@ -30,7 +29,6 @@ class UpdateDefaultAttributeValue implements DataPatchInterface, PatchVersionInt
3029
private $categorySetupFactory;
3130

3231
/**
33-
* PatchInitial constructor.
3432
* @param ModuleDataSetupInterface $moduleDataSetup
3533
* @param CategorySetupFactory $categorySetupFactory
3634
*/
@@ -43,17 +41,24 @@ public function __construct(
4341
}
4442

4543
/**
46-
* {@inheritdoc}
44+
* @inheritdoc
4745
*/
4846
public function apply()
4947
{
5048
/** @var CategorySetup $categorySetup */
5149
$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+
);
56+
57+
return $this;
5358
}
5459

5560
/**
56-
* {@inheritdoc}
61+
* @inheritdoc
5762
*/
5863
public static function getDependencies()
5964
{
@@ -63,15 +68,15 @@ public static function getDependencies()
6368
}
6469

6570
/**
66-
* {@inheritdoc}
71+
* @inheritdoc
6772
*/
6873
public static function getVersion()
6974
{
7075
return '2.0.3';
7176
}
7277

7378
/**
74-
* {@inheritdoc}
79+
* @inheritdoc
7580
*/
7681
public function getAliases()
7782
{

0 commit comments

Comments
 (0)