Cache.php 648 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Cache cleaner backend model
  8. *
  9. */
  10. namespace Magento\Config\Model\Config\Backend;
  11. /**
  12. * @api
  13. * @since 100.0.2
  14. */
  15. class Cache extends \Magento\Framework\App\Config\Value
  16. {
  17. /**
  18. * Cache tags to clean
  19. *
  20. * @var array
  21. */
  22. protected $_cacheTags = [];
  23. /**
  24. * Clean cache, value was changed
  25. *
  26. * @return $this
  27. */
  28. public function afterSave()
  29. {
  30. if ($this->isValueChanged()) {
  31. $this->_cacheManager->clean($this->_cacheTags);
  32. }
  33. return $this;
  34. }
  35. }