Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Tablerate.php
Go to the documentation of this file.
1 <?php
7 
9 
15 class Tablerate extends \Magento\Framework\App\Config\Value
16 {
20  protected $_tablerateFactory;
21 
32  public function __construct(
33  \Magento\Framework\Model\Context $context,
34  \Magento\Framework\Registry $registry,
35  \Magento\Framework\App\Config\ScopeConfigInterface $config,
36  \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,
37  \Magento\OfflineShipping\Model\ResourceModel\Carrier\TablerateFactory $tablerateFactory,
38  \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
39  \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
40  array $data = []
41  ) {
42  $this->_tablerateFactory = $tablerateFactory;
43  parent::__construct($context, $registry, $config, $cacheTypeList, $resource, $resourceCollection, $data);
44  }
45 
49  public function afterSave()
50  {
52  $tableRate = $this->_tablerateFactory->create();
53  $tableRate->uploadAndImport($this);
54  return parent::afterSave();
55  }
56 }
$config
Definition: fraud_order.php:17
$resource
Definition: bulk.php:12
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList, \Magento\OfflineShipping\Model\ResourceModel\Carrier\TablerateFactory $tablerateFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
Definition: Tablerate.php:32