Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
StockCriteria.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
18  public function __construct($mapper = '')
19  {
20  $this->mapperInterfaceName =
21  $mapper ?: \Magento\CatalogInventory\Model\ResourceModel\Stock\StockCriteriaMapper::class;
22  $this->data['initial_condition'] = [true];
23  }
24 
28  public function setScopeFilter($scope)
29  {
30  $this->data['website_filter'] = [$scope];
31  return true;
32  }
33 
40  public function addCriteria(\Magento\CatalogInventory\Api\StockCriteriaInterface $criteria)
41  {
42  $this->data[self::PART_CRITERIA_LIST]['list'][] = $criteria;
43  return true;
44  }
45 }
addCriteria(\Magento\CatalogInventory\Api\StockCriteriaInterface $criteria)