Skip to content

Commit 968eab8

Browse files
committed
Use category collection factory
1 parent 058a129 commit 968eab8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Model/Import/Category.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Magento\Framework\Stdlib\StringUtils;
1919
use Magento\Catalog\Model\Category as CategoryModel;
2020
use Magento\Catalog\Model\ResourceModel\Category\Attribute\Collection as CategoryAttributeCollection;
21-
use Magento\Catalog\Model\ResourceModel\Category\Collection as CategoryCollection;
21+
use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory as CategoryCollectionFactory;
2222
use Magento\Framework\App\Config\ScopeConfigInterface;
2323
use Magento\ImportExport\Model\ImportFactory;
2424
use Magento\ImportExport\Model\ResourceModel\Helper as ImportExportHelper;
@@ -259,9 +259,9 @@ class Category extends \Magento\ImportExport\Model\Import\AbstractEntity
259259
protected $attributeCollection;
260260

261261
/**
262-
* @var \Magento\Catalog\Model\ResourceModel\Category\Collection
262+
* @var CategoryCollectionFactory
263263
*/
264-
protected $categoryCollection;
264+
protected $categoryCollectionFactory;
265265

266266
/**
267267
* @var \Magento\ImportExport\Model\ResourceModel\Helper
@@ -327,7 +327,7 @@ class Category extends \Magento\ImportExport\Model\Import\AbstractEntity
327327
* @param StorageFactory $storageFactory
328328
* @param CategoryModel $defaultCategory
329329
* @param CategoryAttributeCollection $attributeCollection
330-
* @param CategoryCollection $categoryCollection
330+
* @param CategoryCollectionFactory $categoryCollectionFactory
331331
* @param EavConfig $eavConfig
332332
* @param ManagerInterface $eventManager
333333
* @param UploaderFactory $imageUploaderFactory
@@ -349,7 +349,7 @@ public function __construct(
349349
StorageFactory $storageFactory,
350350
CategoryModel $defaultCategory,
351351
CategoryAttributeCollection $attributeCollection,
352-
CategoryCollection $categoryCollection,
352+
CategoryCollectionFactory $categoryCollectionFactory,
353353
EavConfig $eavConfig,
354354
ManagerInterface $eventManager,
355355
UploaderFactory $imageUploaderFactory,
@@ -379,7 +379,7 @@ public function __construct(
379379
$this->storageFactory = $storageFactory;
380380
$this->defaultCategory = $defaultCategory;
381381
$this->attributeCollection = $attributeCollection;
382-
$this->categoryCollection = $categoryCollection;
382+
$this->categoryCollectionFactory = $categoryCollectionFactory;
383383
$this->eventManager = $eventManager;
384384
$this->uploaderFactory = $imageUploaderFactory;
385385
$this->versionFeatures = $versionFeatures;
@@ -544,7 +544,7 @@ protected function initCategories()
544544
*/
545545
protected function getCollection()
546546
{
547-
return $this->categoryCollection->setStoreId(0)->addNameToResult();
547+
return $this->categoryCollectionFactory->create()->setStoreId(0)->addNameToResult();
548548
}
549549

550550
/**

0 commit comments

Comments
 (0)