Translate.php 978 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * System config translate inline fields backend model
  8. */
  9. namespace Magento\Config\Model\Config\Backend;
  10. /**
  11. * @api
  12. * @since 100.0.2
  13. */
  14. class Translate extends \Magento\Framework\App\Config\Value
  15. {
  16. /**
  17. * Path to config node with list of caches
  18. *
  19. * @var string
  20. */
  21. const XML_PATH_INVALID_CACHES = 'dev/translate_inline/invalid_caches';
  22. /**
  23. * Set status 'invalidate' for blocks and other output caches
  24. *
  25. * @return $this
  26. */
  27. public function afterSave()
  28. {
  29. $types = array_keys(
  30. $this->_config->getValue(
  31. self::XML_PATH_INVALID_CACHES,
  32. \Magento\Store\Model\ScopeInterface::SCOPE_STORE
  33. )
  34. );
  35. if ($this->isValueChanged()) {
  36. $this->cacheTypeList->invalidate($types);
  37. }
  38. return parent::afterSave();
  39. }
  40. }