13
13
use Magento \Catalog \Api \Data \CategoryInterface ;
14
14
15
15
/**
16
+ * Category repository
16
17
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
17
18
*/
18
19
class CategoryRepository implements \Magento \Catalog \Api \CategoryRepositoryInterface
@@ -70,7 +71,7 @@ public function __construct(
70
71
}
71
72
72
73
/**
73
- * { @inheritdoc}
74
+ * @inheritdoc
74
75
*/
75
76
public function save (\Magento \Catalog \Api \Data \CategoryInterface $ category )
76
77
{
@@ -106,6 +107,8 @@ public function save(\Magento\Catalog\Api\Data\CategoryInterface $category)
106
107
$ parentCategory = $ this ->get ($ parentId , $ storeId );
107
108
$ existingData ['path ' ] = $ parentCategory ->getPath ();
108
109
$ existingData ['parent_id ' ] = $ parentId ;
110
+ $ existingData ['custom_apply_to_products ' ] = $ existingData ['custom_apply_to_products ' ] ?? 0 ;
111
+ $ existingData ['custom_use_parent_settings ' ] = $ existingData ['custom_use_parent_settings ' ] ?? 0 ;
109
112
}
110
113
$ category ->addData ($ existingData );
111
114
try {
@@ -125,7 +128,7 @@ public function save(\Magento\Catalog\Api\Data\CategoryInterface $category)
125
128
}
126
129
127
130
/**
128
- * { @inheritdoc}
131
+ * @inheritdoc
129
132
*/
130
133
public function get ($ categoryId , $ storeId = null )
131
134
{
@@ -146,7 +149,7 @@ public function get($categoryId, $storeId = null)
146
149
}
147
150
148
151
/**
149
- * { @inheritdoc}
152
+ * @inheritdoc
150
153
*/
151
154
public function delete (\Magento \Catalog \Api \Data \CategoryInterface $ category )
152
155
{
@@ -167,7 +170,7 @@ public function delete(\Magento\Catalog\Api\Data\CategoryInterface $category)
167
170
}
168
171
169
172
/**
170
- * { @inheritdoc}
173
+ * @inheritdoc
171
174
*/
172
175
public function deleteByIdentifier ($ categoryId )
173
176
{
@@ -208,6 +211,8 @@ protected function validateCategory(Category $category)
208
211
}
209
212
210
213
/**
214
+ * Get extensible data object converter
215
+ *
211
216
* @return \Magento\Framework\Api\ExtensibleDataObjectConverter
212
217
*
213
218
* @deprecated 101.0.0
@@ -222,6 +227,8 @@ private function getExtensibleDataObjectConverter()
222
227
}
223
228
224
229
/**
230
+ * Get metadata pool
231
+ *
225
232
* @return \Magento\Framework\EntityManager\MetadataPool
226
233
*/
227
234
private function getMetadataPool ()
0 commit comments