Config.php 949 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Cache configuration model. Provides cache configuration data to the application
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Framework\Cache;
  9. class Config implements ConfigInterface
  10. {
  11. /**
  12. * @var \Magento\Framework\Cache\Config\Data
  13. */
  14. protected $_dataStorage;
  15. /**
  16. * @param \Magento\Framework\Cache\Config\Data $dataStorage
  17. */
  18. public function __construct(\Magento\Framework\Cache\Config\Data $dataStorage)
  19. {
  20. $this->_dataStorage = $dataStorage;
  21. }
  22. /**
  23. * {inheritdoc}
  24. *
  25. * @return array
  26. */
  27. public function getTypes()
  28. {
  29. return $this->_dataStorage->get('types', []);
  30. }
  31. /**
  32. * {inheritdoc}
  33. *
  34. * @param string $type
  35. * @return array
  36. */
  37. public function getType($type)
  38. {
  39. return $this->_dataStorage->get('types/' . $type, []);
  40. }
  41. }