6 declare(strict_types=1);
28 private $stockIndexTableNameResolver;
33 private $defaultStockProvider;
38 private $productTableName;
50 string $productTableName
53 $this->defaultStockProvider = $defaultStockProvider;
54 $this->stockIndexTableNameResolver = $stockIndexTableNameResolver;
55 $this->productTableName = $productTableName;
66 if ($this->defaultStockProvider->getId() === (int)$stockId) {
69 $stockIndexTableName = $this->stockIndexTableNameResolver->execute($stockId);
72 if (
$connection->isTableExists($stockIndexTableName)) {
74 ->from([
'stock_index' => $stockIndexTableName], [])
76 [
'product' => $this->resource->getTableName($this->productTableName)],
__construct(ResourceConnection $resource, StockIndexTableNameResolverInterface $stockIndexTableNameResolver, DefaultStockProviderInterface $defaultStockProvider, string $productTableName)