4
4
* Copyright © Magento, Inc. All rights reserved.
5
5
* See COPYING.txt for license details.
6
6
*/
7
+ declare (strict_types=1 );
7
8
8
9
namespace Magento \Catalog \Model ;
9
10
10
11
use Magento \Framework \Exception \NoSuchEntityException ;
11
12
use Magento \Framework \Exception \StateException ;
12
13
14
+ /**
15
+ * Class \Magento\Catalog\Model\ProductAttributeGroupRepository
16
+ */
13
17
class ProductAttributeGroupRepository implements \Magento \Catalog \Api \ProductAttributeGroupRepositoryInterface
14
18
{
15
19
/**
@@ -43,23 +47,29 @@ public function __construct(
43
47
}
44
48
45
49
/**
46
- * { @inheritdoc}
50
+ * @inheritdoc
47
51
*/
48
52
public function save (\Magento \Eav \Api \Data \AttributeGroupInterface $ group )
49
53
{
54
+ /** @var \Magento\Catalog\Model\Product\Attribute\Group $group */
55
+ $ extensionAttributes = $ group ->getExtensionAttributes ();
56
+ if ($ extensionAttributes ) {
57
+ $ group ->setSortOrder ($ extensionAttributes ->getSortOrder ());
58
+ $ group ->setAttributeGroupCode ($ extensionAttributes ->getAttributeGroupCode ());
59
+ }
50
60
return $ this ->groupRepository ->save ($ group );
51
61
}
52
62
53
63
/**
54
- * { @inheritdoc}
64
+ * @inheritdoc
55
65
*/
56
66
public function getList (\Magento \Framework \Api \SearchCriteriaInterface $ searchCriteria )
57
67
{
58
68
return $ this ->groupRepository ->getList ($ searchCriteria );
59
69
}
60
70
61
71
/**
62
- * { @inheritdoc}
72
+ * @inheritdoc
63
73
*/
64
74
public function get ($ groupId )
65
75
{
@@ -75,7 +85,7 @@ public function get($groupId)
75
85
}
76
86
77
87
/**
78
- * { @inheritdoc}
88
+ * @inheritdoc
79
89
*/
80
90
public function deleteById ($ groupId )
81
91
{
@@ -86,7 +96,7 @@ public function deleteById($groupId)
86
96
}
87
97
88
98
/**
89
- * { @inheritdoc}
99
+ * @inheritdoc
90
100
*/
91
101
public function delete (\Magento \Eav \Api \Data \AttributeGroupInterface $ group )
92
102
{
0 commit comments