Boolean.php 680 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Form Element Boolean Data Model
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Customer\Model\Metadata\Form;
  9. class Boolean extends Select
  10. {
  11. /**
  12. * Return a text for option value
  13. *
  14. * @param int $value
  15. * @return string
  16. */
  17. protected function _getOptionText($value)
  18. {
  19. switch ($value) {
  20. case '0':
  21. $text = __('No');
  22. break;
  23. case '1':
  24. $text = __('Yes');
  25. break;
  26. default:
  27. $text = '';
  28. break;
  29. }
  30. return $text;
  31. }
  32. }