123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Sales\Model\Order\Tax;
- /**
- * Sales Order Tax Item model
- */
- class Item extends \Magento\Framework\Model\AbstractExtensibleModel implements
- \Magento\Tax\Api\Data\OrderTaxDetailsItemInterface
- {
- /**#@+
- * Constants defined for keys of array, makes typos less likely
- */
- const KEY_TYPE = 'type';
- const KEY_ITEM_ID = 'item_id';
- const KEY_ASSOCIATED_ITEM_ID = 'associated_item_id';
- const KEY_APPLIED_TAXES = 'applied_taxes';
- /**#@-*/
- /**
- * {@inheritdoc}
- */
- protected function _construct()
- {
- $this->_init(\Magento\Sales\Model\ResourceModel\Order\Tax\Item::class);
- }
- /**
- * {@inheritdoc}
- */
- public function getType()
- {
- return $this->getData(self::KEY_TYPE);
- }
- /**
- * {@inheritdoc}
- */
- public function getItemId()
- {
- return $this->getData(self::KEY_ITEM_ID);
- }
- /**
- * {@inheritdoc}
- */
- public function getAssociatedItemId()
- {
- return $this->getData(self::KEY_ASSOCIATED_ITEM_ID);
- }
- /**
- * {@inheritdoc}
- */
- public function getAppliedTaxes()
- {
- return $this->getData(self::KEY_APPLIED_TAXES);
- }
- /**
- * Set type (shipping, product, weee, gift wrapping, etc)
- *
- * @param string $type
- * @return $this
- */
- public function setType($type)
- {
- return $this->setData(self::KEY_TYPE, $type);
- }
- /**
- * Set item id
- *
- * @param int $itemId
- * @return $this
- */
- public function setItemId($itemId)
- {
- return $this->setData(self::KEY_ITEM_ID, $itemId);
- }
- /**
- * Set associated item id
- *
- * @param int $associatedItemId
- * @return $this
- */
- public function setAssociatedItemId($associatedItemId)
- {
- return $this->setData(self::KEY_ASSOCIATED_ITEM_ID, $associatedItemId);
- }
- /**
- * Set applied taxes
- *
- * @param \Magento\Tax\Api\Data\OrderTaxDetailsAppliedTaxInterface[] $appliedTaxes
- * @return $this
- */
- public function setAppliedTaxes(array $appliedTaxes = null)
- {
- return $this->setData(self::KEY_APPLIED_TAXES, $appliedTaxes);
- }
- /**
- * {@inheritdoc}
- *
- * @return \Magento\Tax\Api\Data\OrderTaxDetailsItemExtensionInterface|null
- */
- public function getExtensionAttributes()
- {
- return $this->_getExtensionAttributes();
- }
- /**
- * {@inheritdoc}
- *
- * @param \Magento\Tax\Api\Data\OrderTaxDetailsItemExtensionInterface $extensionAttributes
- * @return $this
- */
- public function setExtensionAttributes(
- \Magento\Tax\Api\Data\OrderTaxDetailsItemExtensionInterface $extensionAttributes
- ) {
- return $this->_setExtensionAttributes($extensionAttributes);
- }
- }
|