Interceptor.php 2.46 KB
Newer Older
Ketan's avatar
Ketan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
<?php
namespace Magento\Tax\Model\TaxCalculation;

/**
 * Interceptor class for @see \Magento\Tax\Model\TaxCalculation
 */
class Interceptor extends \Magento\Tax\Model\TaxCalculation implements \Magento\Framework\Interception\InterceptorInterface
{
    use \Magento\Framework\Interception\Interceptor;

    public function __construct(\Magento\Tax\Model\Calculation $calculation, \Magento\Tax\Model\Calculation\CalculatorFactory $calculatorFactory, \Magento\Tax\Model\Config $config, \Magento\Tax\Api\Data\TaxDetailsInterfaceFactory $taxDetailsDataObjectFactory, \Magento\Tax\Api\Data\TaxDetailsItemInterfaceFactory $taxDetailsItemDataObjectFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Tax\Api\TaxClassManagementInterface $taxClassManagement, \Magento\Framework\Api\DataObjectHelper $dataObjectHelper)
    {
        $this->___init();
        parent::__construct($calculation, $calculatorFactory, $config, $taxDetailsDataObjectFactory, $taxDetailsItemDataObjectFactory, $storeManager, $taxClassManagement, $dataObjectHelper);
    }

    /**
     * {@inheritdoc}
     */
    public function calculateTax(\Magento\Tax\Api\Data\QuoteDetailsInterface $quoteDetails, $storeId = null, $round = true)
    {
        $pluginInfo = $this->pluginList->getNext($this->subjectType, 'calculateTax');
        if (!$pluginInfo) {
            return parent::calculateTax($quoteDetails, $storeId, $round);
        } else {
            return $this->___callPlugins('calculateTax', func_get_args(), $pluginInfo);
        }
    }

    /**
     * {@inheritdoc}
     */
    public function getDefaultCalculatedRate($productTaxClassID, $customerId = null, $storeId = null)
    {
        $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getDefaultCalculatedRate');
        if (!$pluginInfo) {
            return parent::getDefaultCalculatedRate($productTaxClassID, $customerId, $storeId);
        } else {
            return $this->___callPlugins('getDefaultCalculatedRate', func_get_args(), $pluginInfo);
        }
    }

    /**
     * {@inheritdoc}
     */
    public function getCalculatedRate($productTaxClassID, $customerId = null, $storeId = null)
    {
        $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getCalculatedRate');
        if (!$pluginInfo) {
            return parent::getCalculatedRate($productTaxClassID, $customerId, $storeId);
        } else {
            return $this->___callPlugins('getCalculatedRate', func_get_args(), $pluginInfo);
        }
    }
}