Store.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Backend add store code to url backend
  8. */
  9. namespace Magento\Config\Model\Config\Backend;
  10. /**
  11. * @api
  12. * @since 100.0.2
  13. */
  14. class Store extends \Magento\Framework\App\Config\Value
  15. {
  16. /**
  17. * @var \Magento\Framework\App\Config\MutableScopeConfigInterface
  18. */
  19. protected $_mutableConfig;
  20. /**
  21. * @param \Magento\Framework\Model\Context $context
  22. * @param \Magento\Framework\Registry $registry
  23. * @param \Magento\Framework\App\Config\ScopeConfigInterface $config
  24. * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList
  25. * @param \Magento\Framework\App\Config\MutableScopeConfigInterface $mutableConfig
  26. * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
  27. * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
  28. * @param array $data
  29. */
  30. public function __construct(
  31. \Magento\Framework\Model\Context $context,
  32. \Magento\Framework\Registry $registry,
  33. \Magento\Framework\App\Config\ScopeConfigInterface $config,
  34. \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,
  35. \Magento\Framework\App\Config\MutableScopeConfigInterface $mutableConfig,
  36. \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
  37. \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
  38. array $data = []
  39. ) {
  40. parent::__construct($context, $registry, $config, $cacheTypeList, $resource, $resourceCollection, $data);
  41. $this->_mutableConfig = $mutableConfig;
  42. }
  43. /**
  44. * @return $this
  45. */
  46. public function afterSave()
  47. {
  48. $this->_cacheManager->clean();
  49. return parent::afterSave();
  50. }
  51. }