Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PreventProcessDefaultStockLinksPlugin.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
12 
17 {
21  private $defaultStockProvider;
22 
26  public function __construct(DefaultStockProviderInterface $defaultStockProvider)
27  {
28  $this->defaultStockProvider = $defaultStockProvider;
29  }
30 
41  public function aroundProcess(StockSourceLinkProcessor $subject, \Closure $proceed, int $stockId, array $linksData)
42  {
43  if ($stockId !== $this->defaultStockProvider->getId()) {
44  $proceed($stockId, $linksData);
45  }
46  }
47 }