9
9
use Magento \Catalog \Model \Category ;
10
10
use Magento \Catalog \Model \CategoryFactory ;
11
11
use Magento \Catalog \Model \ResourceModel \Category \CollectionFactory ;
12
+ use Magento \Store \Model \Store ;
12
13
use Magento \Store \Model \StoreManager ;
13
14
14
15
/**
@@ -82,7 +83,7 @@ public function __construct(
82
83
protected $ priority = 20 ;
83
84
84
85
/**
85
- * { @inheritdoc}
86
+ * @inheritdoc
86
87
*/
87
88
public function execute ()
88
89
{
@@ -97,7 +98,7 @@ public function execute()
97
98
$ category = $ this ->categoryFactory ->create ();
98
99
$ category ->load ($ parentCategoryId );
99
100
// Need for generation url rewrites per all category store view
100
- $ category ->setStoreId (\ Magento \ Store \ Model \ Store::DEFAULT_STORE_ID );
101
+ $ category ->setStoreId (Store::DEFAULT_STORE_ID );
101
102
$ categoryIndex = 1 ;
102
103
$ this ->generateCategories (
103
104
$ category ,
@@ -130,6 +131,7 @@ private function generateCategories(
130
131
$ category ->setId (null )
131
132
->setUrlKey (null )
132
133
->setUrlPath (null )
134
+ ->setStoreId (Store::DEFAULT_STORE_ID )
133
135
->setName ($ this ->getCategoryName ($ parentCategory , $ nestingLevel , $ i ))
134
136
->setParentId ($ parentCategory ->getId ())
135
137
->setLevel ($ parentCategory ->getLevel () + 1 )
@@ -237,15 +239,15 @@ private function getCategoryPrefix()
237
239
}
238
240
239
241
/**
240
- * { @inheritdoc}
242
+ * @inheritdoc
241
243
*/
242
244
public function getActionTitle ()
243
245
{
244
246
return 'Generating categories ' ;
245
247
}
246
248
247
249
/**
248
- * { @inheritdoc}
250
+ * @inheritdoc
249
251
*/
250
252
public function introduceParamLabels ()
251
253
{
0 commit comments