Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
StockSourceLink.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
12 use Magento\InventoryApi\Api\Data\StockSourceLinkExtensionInterface;
14 
21 {
25  protected function _construct()
26  {
27  $this->_init(StockSourceLinkResourceModel::class);
28  }
29 
33  public function getSourceCode(): ?string
34  {
35  return $this->getData(self::SOURCE_CODE);
36  }
37 
41  public function setSourceCode(?string $sourceCode): void
42  {
43  $this->setData(self::SOURCE_CODE, $sourceCode);
44  }
45 
49  public function getStockId(): ?int
50  {
51  return $this->getData(self::STOCK_ID) === null ?
52  null:
53  (int)$this->getData(self::STOCK_ID);
54  }
55 
59  public function setStockId(?int $stockId): void
60  {
61  $this->setData(self::STOCK_ID, $stockId);
62  }
63 
67  public function getPriority(): ?int
68  {
69  return $this->getData(self::PRIORITY) === null ?
70  null:
71  (int)$this->getData(self::PRIORITY);
72  }
73 
77  public function setPriority(?int $priority): void
78  {
79  $this->setData(self::PRIORITY, $priority);
80  }
81 
85  public function getExtensionAttributes(): ?StockSourceLinkExtensionInterface
86  {
88  if (null === $extensionAttributes) {
89  $extensionAttributes = $this->extensionAttributesFactory->create(StockSourceLinkInterface::class);
91  }
92  return $extensionAttributes;
93  }
94 
98  public function setExtensionAttributes(StockSourceLinkExtensionInterface $extensionAttributes): void
99  {
100  $this->_setExtensionAttributes($extensionAttributes);
101  }
102 }
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
$sourceCode
Definition: inventory.phtml:11