Currency.php 948 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Locale currency source
  8. */
  9. namespace Magento\Config\Model\Config\Source\Locale;
  10. /**
  11. * @api
  12. * @since 100.0.2
  13. */
  14. class Currency implements \Magento\Framework\Option\ArrayInterface
  15. {
  16. /**
  17. * @var array
  18. */
  19. protected $_options;
  20. /**
  21. * @var \Magento\Framework\Locale\ListsInterface
  22. */
  23. protected $_localeLists;
  24. /**
  25. * @param \Magento\Framework\Locale\ListsInterface $localeLists
  26. */
  27. public function __construct(\Magento\Framework\Locale\ListsInterface $localeLists)
  28. {
  29. $this->_localeLists = $localeLists;
  30. }
  31. /**
  32. * @return array
  33. */
  34. public function toOptionArray()
  35. {
  36. if (!$this->_options) {
  37. $this->_options = $this->_localeLists->getOptionCurrencies();
  38. }
  39. $options = $this->_options;
  40. return $options;
  41. }
  42. }