Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Stock.php
Go to the documentation of this file.
1 <?php
7 
10 
16 {
20  const ENTITY = 'cataloginventory_stock';
21 
27  protected $_eventPrefix = 'cataloginventory_stock';
28 
35  protected $_eventObject = 'stock';
36 
37  const BACKORDERS_NO = 0;
38 
40 
42 
43  const STOCK_OUT_OF_STOCK = 0;
44 
45  const STOCK_IN_STOCK = 1;
46 
47  const WEBSITE_ID = 'website_id';
48 
52  const DEFAULT_STOCK_ID = 1;
53 
57  protected function _construct()
58  {
59  $this->_init(\Magento\CatalogInventory\Model\ResourceModel\Stock::class);
60  }
61 
62  //@codeCoverageIgnoreStart
63 
69  public function getStockId()
70  {
71  return $this->_getData(self::STOCK_ID);
72  }
73 
79  public function getWebsiteId()
80  {
81  return $this->_getData(self::WEBSITE_ID);
82  }
83 
89  public function getStockName()
90  {
91  return $this->_getData(self::STOCK_NAME);
92  }
93 
100  public function setStockId($stockId)
101  {
102  return $this->setData(self::STOCK_ID, $stockId);
103  }
104 
111  public function setWebsiteId($websiteId)
112  {
113  return $this->setData(self::WEBSITE_ID, $websiteId);
114  }
115 
122  public function setStockName($stockName)
123  {
124  return $this->setData(self::STOCK_NAME, $stockName);
125  }
126 
132  public function getExtensionAttributes()
133  {
134  return $this->_getExtensionAttributes();
135  }
136 
143  public function setExtensionAttributes(
144  \Magento\CatalogInventory\Api\Data\StockExtensionInterface $extensionAttributes
145  ) {
146  return $this->_setExtensionAttributes($extensionAttributes);
147  }
148 
149  //@codeCoverageIgnoreEnd
150 }
setExtensionAttributes(\Magento\CatalogInventory\Api\Data\StockExtensionInterface $extensionAttributes)
Definition: Stock.php:143
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)