Boolean.php 787 B

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