Skip to content

Commit

Permalink
Merge pull request #113 from firegento/use-factory
Browse files Browse the repository at this point in the history
Use category collection factory
  • Loading branch information
sprankhub authored Mar 26, 2021
2 parents 058a129 + 968eab8 commit ce4428b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Model/Import/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Magento\Framework\Stdlib\StringUtils;
use Magento\Catalog\Model\Category as CategoryModel;
use Magento\Catalog\Model\ResourceModel\Category\Attribute\Collection as CategoryAttributeCollection;
use Magento\Catalog\Model\ResourceModel\Category\Collection as CategoryCollection;
use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory as CategoryCollectionFactory;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\ImportExport\Model\ImportFactory;
use Magento\ImportExport\Model\ResourceModel\Helper as ImportExportHelper;
Expand Down Expand Up @@ -259,9 +259,9 @@ class Category extends \Magento\ImportExport\Model\Import\AbstractEntity
protected $attributeCollection;

/**
* @var \Magento\Catalog\Model\ResourceModel\Category\Collection
* @var CategoryCollectionFactory
*/
protected $categoryCollection;
protected $categoryCollectionFactory;

/**
* @var \Magento\ImportExport\Model\ResourceModel\Helper
Expand Down Expand Up @@ -327,7 +327,7 @@ class Category extends \Magento\ImportExport\Model\Import\AbstractEntity
* @param StorageFactory $storageFactory
* @param CategoryModel $defaultCategory
* @param CategoryAttributeCollection $attributeCollection
* @param CategoryCollection $categoryCollection
* @param CategoryCollectionFactory $categoryCollectionFactory
* @param EavConfig $eavConfig
* @param ManagerInterface $eventManager
* @param UploaderFactory $imageUploaderFactory
Expand All @@ -349,7 +349,7 @@ public function __construct(
StorageFactory $storageFactory,
CategoryModel $defaultCategory,
CategoryAttributeCollection $attributeCollection,
CategoryCollection $categoryCollection,
CategoryCollectionFactory $categoryCollectionFactory,
EavConfig $eavConfig,
ManagerInterface $eventManager,
UploaderFactory $imageUploaderFactory,
Expand Down Expand Up @@ -379,7 +379,7 @@ public function __construct(
$this->storageFactory = $storageFactory;
$this->defaultCategory = $defaultCategory;
$this->attributeCollection = $attributeCollection;
$this->categoryCollection = $categoryCollection;
$this->categoryCollectionFactory = $categoryCollectionFactory;
$this->eventManager = $eventManager;
$this->uploaderFactory = $imageUploaderFactory;
$this->versionFeatures = $versionFeatures;
Expand Down Expand Up @@ -544,7 +544,7 @@ protected function initCategories()
*/
protected function getCollection()
{
return $this->categoryCollection->setStoreId(0)->addNameToResult();
return $this->categoryCollectionFactory->create()->setStoreId(0)->addNameToResult();
}

/**
Expand Down

0 comments on commit ce4428b

Please sign in to comment.