Skip to content

Commit ac6f209

Browse files
committed
MAGETWO-55299: [Customer] Fast Save of Product Variations
- MAGETWO-55787: Fast saving of product with high number of variations generated
1 parent 05af89c commit ac6f209

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

app/code/Magento/CatalogInventory/Model/Stock/StockItemRepository.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ class StockItemRepository implements StockItemRepositoryInterface
9090
*/
9191
protected $stockRegistryStorage;
9292

93+
/** @var \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory */
94+
protected $productCollectionFactory;
95+
9396
/**
9497
* @param StockConfigurationInterface $stockConfiguration
9598
* @param StockStateProviderInterface $stockStateProvider
@@ -130,6 +133,20 @@ public function __construct(
130133
$this->dateTime = $dateTime;
131134
}
132135

136+
/**
137+
* @return \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory
138+
*/
139+
private function getProductCollectionFactory()
140+
{
141+
if ($this->productCollectionFactory === null) {
142+
$this->productCollectionFactory = ObjectManager::getInstance()->get(
143+
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory::class
144+
);
145+
}
146+
147+
return $this->productCollectionFactory;
148+
}
149+
133150
/**
134151
* @inheritdoc
135152
*/

0 commit comments

Comments
 (0)