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
6 declare(strict_types=1);
7 
9 
14 
21 {
25  protected function _construct()
26  {
27  $this->_init(StockResourceModel::class);
28  }
29 
33  public function getStockId(): ?int
34  {
35  return $this->getData(self::STOCK_ID) === null ?
36  null:
37  (int)$this->getData(self::STOCK_ID);
38  }
39 
43  public function setStockId(?int $stockId): void
44  {
45  $this->setData(self::STOCK_ID, $stockId);
46  }
47 
51  public function getName(): ?string
52  {
53  return $this->getData(self::NAME);
54  }
55 
59  public function setName(?string $name): void
60  {
61  $this->setData(self::NAME, $name);
62  }
63 
68  {
70  if (null === $extensionAttributes) {
71  $extensionAttributes = $this->extensionAttributesFactory->create(StockInterface::class);
73  }
74  return $extensionAttributes;
75  }
76 
81  {
82  $this->_setExtensionAttributes($extensionAttributes);
83  }
84 }
setExtensionAttributes(StockExtensionInterface $extensionAttributes)
Definition: Stock.php:80
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
setStockId(?int $stockId)
Definition: Stock.php:43
setName(?string $name)
Definition: Stock.php:59
if(!isset($_GET['name'])) $name
Definition: log.php:14