ResetMethod.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Security\Model\Config\Source;
  7. /**
  8. * Source model for setting "Limit Password Reset Requests Method"
  9. *
  10. */
  11. class ResetMethod implements \Magento\Framework\Option\ArrayInterface
  12. {
  13. const OPTION_BY_IP_AND_EMAIL = 1;
  14. const OPTION_BY_IP = 2;
  15. const OPTION_BY_EMAIL = 3;
  16. const OPTION_NONE = 0;
  17. /**
  18. * Options getter
  19. *
  20. * @return array
  21. */
  22. public function toOptionArray()
  23. {
  24. return [
  25. ['value' => self::OPTION_BY_IP_AND_EMAIL, 'label' => __('By IP and Email')],
  26. ['value' => self::OPTION_BY_IP, 'label' => __('By IP')],
  27. ['value' => self::OPTION_BY_EMAIL, 'label' => __('By Email')],
  28. ['value' => self::OPTION_NONE, 'label' => __('None')],
  29. ];
  30. }
  31. /**
  32. * Get options in "key-value" format
  33. *
  34. * @return array
  35. */
  36. public function toArray()
  37. {
  38. return [
  39. self::OPTION_BY_IP_AND_EMAIL => __('By IP and Email'),
  40. self::OPTION_BY_IP => __('By IP'),
  41. self::OPTION_BY_EMAIL => __('By Email'),
  42. self::OPTION_NONE => __('None'),
  43. ];
  44. }
  45. }