Skip to content

Commit

Permalink
Merge branch 'fix_issue_26449' of https://github.com/tna274/magento2
Browse files Browse the repository at this point in the history
…into fix_issue_26449
  • Loading branch information
tna274 committed Mar 22, 2020
2 parents 1efecdf + 19ceb3a commit 1e9895d
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Magento\Framework\Indexer\ActionInterface;
use Magento\ConfigurableProduct\Api\Data\OptionInterface;
use Magento\Catalog\Api\Data\ProductAttributeInterface;
use Magento\Framework\App\ObjectManager;

/**
* Plugin product resource model
Expand Down Expand Up @@ -55,15 +56,18 @@ class Product
public function __construct(
Configurable $configurable,
ActionInterface $productIndexer,
ProductAttributeRepositoryInterface $productAttributeRepository,
\Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder,
\Magento\Framework\Api\FilterBuilder $filterBuilder
ProductAttributeRepositoryInterface $productAttributeRepository = null,
\Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder = null,
\Magento\Framework\Api\FilterBuilder $filterBuilder = null
) {
$this->configurable = $configurable;
$this->productIndexer = $productIndexer;
$this->productAttributeRepository = $productAttributeRepository;
$this->searchCriteriaBuilder = $searchCriteriaBuilder;
$this->filterBuilder = $filterBuilder;
$this->productAttributeRepository = $productAttributeRepository ?: ObjectManager::getInstance()
->get(ProductAttributeRepositoryInterface::class);
$this->searchCriteriaBuilder = $searchCriteriaBuilder ?: ObjectManager::getInstance()
->get(\Magento\Framework\Api\SearchCriteriaBuilder::class);
$this->filterBuilder = $filterBuilder ?: ObjectManager::getInstance()
->get(\Magento\Framework\Api\FilterBuilder::class);
}

/**
Expand Down

0 comments on commit 1e9895d

Please sign in to comment.