|
17 | 17 | use Algolia\AlgoliaSearch\Helper\Logger;
|
18 | 18 | use Algolia\AlgoliaSearch\Service\IndexNameFetcher;
|
19 | 19 | use Magento\Bundle\Model\Product\Type as BundleProductType;
|
| 20 | +use Magento\Catalog\Api\Data\ProductInterfaceFactory; |
20 | 21 | use Magento\Catalog\Model\Product;
|
21 | 22 | use Magento\Catalog\Model\Product\Attribute\Source\Status;
|
22 | 23 | use Magento\Catalog\Model\Product\Type;
|
@@ -108,7 +109,8 @@ public function __construct(
|
108 | 109 | protected GroupExcludedWebsiteRepositoryInterface $groupExcludedWebsiteRepository,
|
109 | 110 | protected ImageHelper $imageHelper,
|
110 | 111 | protected IndexNameFetcher $indexNameFetcher,
|
111 |
| - protected ReplicaManagerInterface $replicaManager |
| 112 | + protected ReplicaManagerInterface $replicaManager, |
| 113 | + protected ProductInterfaceFactory $productFactory |
112 | 114 | )
|
113 | 115 | {
|
114 | 116 | parent::__construct($indexNameFetcher);
|
@@ -545,7 +547,7 @@ public function getParentProductIds(array $productIds): array
|
545 | 547 | protected function getCompositeTypes(): array
|
546 | 548 | {
|
547 | 549 | if ($this->compositeTypes === null) {
|
548 |
| - $productEmulator = new DataObject(); |
| 550 | + $productEmulator = $this->productFactory->create(); |
549 | 551 | foreach ($this->productType->getCompositeTypes() as $typeId) {
|
550 | 552 | $productEmulator->setTypeId($typeId);
|
551 | 553 | $this->compositeTypes[$typeId] = $this->productType->factory($productEmulator);
|
|
0 commit comments