Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Item.php
Go to the documentation of this file.
1 <?php
7 
9 
48 {
49  const XML_PATH_ORDER_ITEM_STATUS = 'catalog/downloadable/order_item_status';
50 
51  const LINK_STATUS_PENDING = 'pending';
52 
53  const LINK_STATUS_AVAILABLE = 'available';
54 
55  const LINK_STATUS_EXPIRED = 'expired';
56 
57  const LINK_STATUS_PENDING_PAYMENT = 'pending_payment';
58 
59  const LINK_STATUS_PAYMENT_REVIEW = 'payment_review';
60 
66  protected function _construct()
67  {
68  $this->_init(\Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item::class);
69  parent::_construct();
70  }
71 
78  public function beforeSave()
79  {
80  if (null == $this->getOrderItemId()) {
81  throw new \Exception(__('Order item id cannot be null'));
82  }
83  return parent::beforeSave();
84  }
85 }
__()
Definition: __.php:13