Enabledisable.php 791 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Config\Model\Config\Source;
  7. /**
  8. * Source model for element with enable and disable variants.
  9. * @api
  10. * @since 100.0.2
  11. */
  12. class Enabledisable implements \Magento\Framework\Option\ArrayInterface
  13. {
  14. /**
  15. * Value which equal Enable for Enabledisable dropdown.
  16. */
  17. const ENABLE_VALUE = 1;
  18. /**
  19. * Value which equal Disable for Enabledisable dropdown.
  20. */
  21. const DISABLE_VALUE = 0;
  22. /**
  23. * @return array
  24. */
  25. public function toOptionArray()
  26. {
  27. return [
  28. ['value' => self::ENABLE_VALUE, 'label' => __('Enable')],
  29. ['value' => self::DISABLE_VALUE, 'label' => __('Disable')],
  30. ];
  31. }
  32. }