Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ProductCollectionStockCondition.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Catalog\Model\CollectionConditionInterface;
12 
19 {
23  private $stockHelper;
24 
29  public function __construct(\Magento\CatalogInventory\Helper\Stock $stockHelper)
30  {
31  $this->stockHelper = $stockHelper;
32  }
33 
37  public function apply(AbstractDb $collection)
38  {
39  $this->stockHelper->addIsInStockFilterToCollection($collection);
40  }
41 }
__construct(\Magento\CatalogInventory\Helper\Stock $stockHelper)