Options.php 1018 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Eav\Model\Adminhtml\Attribute\Validation\Rules;
  7. /**
  8. * Class Options
  9. */
  10. class Options implements \Magento\Framework\Data\OptionSourceInterface
  11. {
  12. /**
  13. * Return array of options as value-label pairs
  14. *
  15. * @return array Format: array(array('value' => '<value>', 'label' => '<label>'), ...)
  16. */
  17. public function toOptionArray()
  18. {
  19. return [
  20. ['value' => '', 'label' => __('None')],
  21. ['value' => 'validate-number', 'label' => __('Decimal Number')],
  22. ['value' => 'validate-digits', 'label' => __('Integer Number')],
  23. ['value' => 'validate-email', 'label' => __('Email')],
  24. ['value' => 'validate-url', 'label' => __('URL')],
  25. ['value' => 'validate-alpha', 'label' => __('Letters')],
  26. ['value' => 'validate-alphanum', 'label' => __('Letters (a-z, A-Z) or Numbers (0-9)')]
  27. ];
  28. }
  29. }