Application.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Used in creating options for Caching Application config value selection
  8. */
  9. namespace Magento\PageCache\Model\System\Config\Source;
  10. use Magento\Framework\Option\ArrayInterface;
  11. use Magento\PageCache\Model\Config;
  12. /**
  13. * Class Application
  14. */
  15. class Application implements ArrayInterface
  16. {
  17. /**
  18. * Options getter
  19. *
  20. * @return array
  21. */
  22. public function toOptionArray()
  23. {
  24. return [
  25. [
  26. 'value' => Config::BUILT_IN,
  27. 'label' => __('Built-in Cache')
  28. ],
  29. [
  30. 'value' => Config::VARNISH,
  31. 'label' => __('Varnish Cache (Recommended)')
  32. ]
  33. ];
  34. }
  35. /**
  36. * Get options in "key-value" format
  37. *
  38. * @return array
  39. */
  40. public function toArray()
  41. {
  42. return [
  43. Config::BUILT_IN => __('Built-in Cache'),
  44. Config::VARNISH => __('Varnish Cache (Recommended)')
  45. ];
  46. }
  47. }