Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AddStockStatusToSelect.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
13 
18 {
22  private $stockIndexTableNameResolver;
23 
27  public function __construct(StockIndexTableNameResolverInterface $stockIndexTableNameResolver)
28  {
29  $this->stockIndexTableNameResolver = $stockIndexTableNameResolver;
30  }
31 
37  public function execute(Select $select, int $stockId)
38  {
39  $tableName = $this->stockIndexTableNameResolver->execute($stockId);
40 
41  $select->joinLeft(
42  ['stock_status' => $tableName],
43  'e.sku = stock_status.sku',
45  );
46  }
47 }
$tableName
Definition: trigger.php:13
__construct(StockIndexTableNameResolverInterface $stockIndexTableNameResolver)