123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Tax\Model\TaxDetails;
- use Magento\Framework\Model\AbstractExtensibleModel;
- use Magento\Tax\Api\Data\TaxDetailsInterface;
- /**
- * @codeCoverageIgnore
- */
- class TaxDetails extends AbstractExtensibleModel implements TaxDetailsInterface
- {
- /**#@+
- * Constants defined for keys of array, makes typos less likely
- */
- const KEY_SUBTOTAL = 'subtotal';
- const KEY_TAX_AMOUNT = 'tax_amount';
- const KEY_APPLIED_TAXES = 'applied_taxes';
- const KEY_ITEMS = 'items';
- const KEY_DISCOUNT_TAX_COMPENSATION_AMOUNT = 'discount_tax_compensation_amount';
- /**#@-*/
- /**
- * {@inheritdoc}
- */
- public function getSubtotal()
- {
- return $this->getData(self::KEY_SUBTOTAL);
- }
- /**
- * {@inheritdoc}
- */
- public function getTaxAmount()
- {
- return $this->getData(self::KEY_TAX_AMOUNT);
- }
- /**
- * {@inheritdoc}
- */
- public function getDiscountTaxCompensationAmount()
- {
- return $this->getData(self::KEY_DISCOUNT_TAX_COMPENSATION_AMOUNT);
- }
- /**
- * {@inheritdoc}
- */
- public function getAppliedTaxes()
- {
- return $this->getData(self::KEY_APPLIED_TAXES);
- }
- /**
- * {@inheritdoc}
- */
- public function getItems()
- {
- return $this->getData(self::KEY_ITEMS);
- }
- /**
- * Set subtotal
- *
- * @param float $subtotal
- * @return $this
- */
- public function setSubtotal($subtotal)
- {
- return $this->setData(self::KEY_SUBTOTAL, $subtotal);
- }
- /**
- * Set tax amount
- *
- * @param float $taxAmount
- * @return $this
- */
- public function setTaxAmount($taxAmount)
- {
- return $this->setData(self::KEY_TAX_AMOUNT, $taxAmount);
- }
- /**
- * Set discount amount
- *
- * @param float $discountTaxCompensationAmount
- * @return $this
- */
- public function setDiscountTaxCompensationAmount($discountTaxCompensationAmount)
- {
- return $this->setData(
- self::KEY_DISCOUNT_TAX_COMPENSATION_AMOUNT,
- $discountTaxCompensationAmount
- );
- }
- /**
- * Set applied taxes
- *
- * @param \Magento\Tax\Api\Data\AppliedTaxInterface[] $appliedTaxes
- * @return $this
- */
- public function setAppliedTaxes(array $appliedTaxes = null)
- {
- return $this->setData(self::KEY_APPLIED_TAXES, $appliedTaxes);
- }
- /**
- * Set TaxDetails items
- *
- * @param \Magento\Tax\Api\Data\TaxDetailsItemInterface[] $items
- * @return $this
- */
- public function setItems(array $items = null)
- {
- return $this->setData(self::KEY_ITEMS, $items);
- }
- /**
- * {@inheritdoc}
- *
- * @return \Magento\Tax\Api\Data\TaxDetailsExtensionInterface|null
- */
- public function getExtensionAttributes()
- {
- return $this->_getExtensionAttributes();
- }
- /**
- * {@inheritdoc}
- *
- * @param \Magento\Tax\Api\Data\TaxDetailsExtensionInterface $extensionAttributes
- * @return $this
- */
- public function setExtensionAttributes(\Magento\Tax\Api\Data\TaxDetailsExtensionInterface $extensionAttributes)
- {
- return $this->_setExtensionAttributes($extensionAttributes);
- }
- }
|