Locale.php 749 B

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