Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ProductLinks.php
Go to the documentation of this file.
1 <?php
8 
13 
15 {
19  private $configuration;
20 
24  private $stockHelper;
25 
32  public function __construct(Configuration $configuration, Stock $stockHelper)
33  {
34  $this->configuration = $configuration;
35  $this->stockHelper = $stockHelper;
36  }
37 
45  {
46  if ($this->configuration->isShowOutOfStock() != 1) {
47  $this->stockHelper->addInStockFilterToCollection($collection);
48  }
49  return $collection;
50  }
51 }
$configuration
Definition: index.php:33