Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
InStockOptionSelectBuilder.php
Go to the documentation of this file.
1 <?php
7 
11 
16 {
22  private $stockStatusResource;
23 
27  public function __construct(Status $stockStatusResource)
28  {
29  $this->stockStatusResource = $stockStatusResource;
30  }
31 
42  {
43  $select->joinInner(
44  ['stock' => $this->stockStatusResource->getMainTable()],
45  'stock.product_id = entity.entity_id',
46  []
47  )->where(
48  'stock.stock_status = ?',
49  \Magento\CatalogInventory\Model\Stock\Status::STATUS_IN_STOCK
50  );
51 
52  return $select;
53  }
54 }