Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SalesEvent.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
12 use Magento\InventorySalesApi\Api\Data\SalesEventExtensionInterface;
13 
18 {
22  private $type;
23 
27  private $objectType;
28 
32  private $objectId;
33 
48  public function __construct(
49  \Magento\Framework\Model\Context $context,
50  \Magento\Framework\Registry $registry,
51  \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
52  \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory,
53  string $type,
54  string $objectType,
55  string $objectId,
56  \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
57  \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
58  array $data = []
59  ) {
60  parent::__construct(
61  $context,
62  $registry,
63  $extensionFactory,
65  $resource,
66  $resourceCollection,
67  $data
68  );
69 
70  $this->type = $type;
71  $this->objectType = $objectType;
72  $this->objectId = $objectId;
73  }
74 
78  public function getType(): string
79  {
80  return $this->type;
81  }
82 
86  public function getObjectType(): string
87  {
88  return $this->objectType;
89  }
90 
94  public function getObjectId(): string
95  {
96  return $this->objectId;
97  }
98 
102  public function getExtensionAttributes(): ?SalesEventExtensionInterface
103  {
105  if (null === $extensionAttributes) {
106  $extensionAttributes = $this->extensionAttributesFactory->create(SalesEventInterface::class);
108  }
109  return $extensionAttributes;
110  }
111 
115  public function setExtensionAttributes(SalesEventExtensionInterface $extensionAttributes): void
116  {
117  $this->_setExtensionAttributes($extensionAttributes);
118  }
119 }
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory, \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory, string $type, string $objectType, string $objectId, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
Definition: SalesEvent.php:48
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
$resource
Definition: bulk.php:12
$type
Definition: item.phtml:13
setExtensionAttributes(SalesEventExtensionInterface $extensionAttributes)
Definition: SalesEvent.php:115