Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Rate.php
Go to the documentation of this file.
1 <?php
8 
10 
16 abstract class Rate extends \Magento\Backend\App\Action
17 {
23  const ADMIN_RESOURCE = 'Magento_Tax::manage_tax';
24 
28  protected $_coreRegistry;
29 
33  protected $_taxRateConverter;
34 
39 
46  public function __construct(
47  \Magento\Backend\App\Action\Context $context,
48  \Magento\Framework\Registry $coreRegistry,
49  \Magento\Tax\Model\Calculation\Rate\Converter $taxRateConverter,
50  \Magento\Tax\Api\TaxRateRepositoryInterface $taxRateRepository
51  ) {
52  $this->_coreRegistry = $coreRegistry;
53  $this->_taxRateConverter = $taxRateConverter;
54  $this->_taxRateRepository = $taxRateRepository;
55  parent::__construct($context);
56  }
57 
64  protected function _processRateData($rateData)
65  {
66  $result = [];
67  foreach ($rateData as $key => $value) {
68  if (is_array($value)) {
69  $result[$key] = $this->_processRateData($value);
70  } else {
71  $result[$key] = trim($value);
72  }
73  }
74  return $result;
75  }
76 
82  protected function initResultPage()
83  {
84  $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
85  $resultPage->setActiveMenu('Magento_Tax::sales_tax_rates')
86  ->addBreadcrumb(__('Sales'), __('Sales'))
87  ->addBreadcrumb(__('Tax'), __('Tax'));
88  return $resultPage;
89  }
90 }
__()
Definition: __.php:13
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Tax\Model\Calculation\Rate\Converter $taxRateConverter, \Magento\Tax\Api\TaxRateRepositoryInterface $taxRateRepository)
Definition: Rate.php:46
$value
Definition: gender.phtml:16