DEVICE_HIRE_SOURCE.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # NO CHECKED-IN PROTOBUF GENCODE
  4. # source: api/EntOrder.proto
  5. namespace Proto\Api;
  6. use UnexpectedValueException;
  7. /**
  8. * 设备租赁来源/类型
  9. *
  10. * Protobuf type <code>proto.api.DEVICE_HIRE_SOURCE</code>
  11. */
  12. class DEVICE_HIRE_SOURCE
  13. {
  14. /**
  15. * 保留
  16. *
  17. * Generated from protobuf enum <code>DEVICE_HIRE_SOURCE_RESERVED = 0;</code>
  18. */
  19. const DEVICE_HIRE_SOURCE_RESERVED = 0;
  20. /**
  21. * 门店
  22. *
  23. * Generated from protobuf enum <code>DEVICE_HIRE_SOURCE_SHOP = 1;</code>
  24. */
  25. const DEVICE_HIRE_SOURCE_SHOP = 1;
  26. /**
  27. * 换电柜
  28. *
  29. * Generated from protobuf enum <code>DEVICE_HIRE_SOURCE_CABINET = 2;</code>
  30. */
  31. const DEVICE_HIRE_SOURCE_CABINET = 2;
  32. /**
  33. * 手动绑定
  34. *
  35. * Generated from protobuf enum <code>DEVICE_HIRE_SOURCE_BIND = 3;</code>
  36. */
  37. const DEVICE_HIRE_SOURCE_BIND = 3;
  38. /**
  39. * IC卡
  40. *
  41. * Generated from protobuf enum <code>DEVICE_HIRE_SOURCE_IC = 4;</code>
  42. */
  43. const DEVICE_HIRE_SOURCE_IC = 4;
  44. /**
  45. * 充电柜
  46. *
  47. * Generated from protobuf enum <code>DEVICE_HIRE_SOURCE_CHARGE = 5;</code>
  48. */
  49. const DEVICE_HIRE_SOURCE_CHARGE = 5;
  50. private static $valueToName = [
  51. self::DEVICE_HIRE_SOURCE_RESERVED => 'DEVICE_HIRE_SOURCE_RESERVED',
  52. self::DEVICE_HIRE_SOURCE_SHOP => 'DEVICE_HIRE_SOURCE_SHOP',
  53. self::DEVICE_HIRE_SOURCE_CABINET => 'DEVICE_HIRE_SOURCE_CABINET',
  54. self::DEVICE_HIRE_SOURCE_BIND => 'DEVICE_HIRE_SOURCE_BIND',
  55. self::DEVICE_HIRE_SOURCE_IC => 'DEVICE_HIRE_SOURCE_IC',
  56. self::DEVICE_HIRE_SOURCE_CHARGE => 'DEVICE_HIRE_SOURCE_CHARGE',
  57. ];
  58. public static function name($value)
  59. {
  60. if (!isset(self::$valueToName[$value])) {
  61. throw new UnexpectedValueException(sprintf(
  62. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  63. }
  64. return self::$valueToName[$value];
  65. }
  66. public static function value($name)
  67. {
  68. $const = __CLASS__ . '::' . strtoupper($name);
  69. if (!defined($const)) {
  70. throw new UnexpectedValueException(sprintf(
  71. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  72. }
  73. return constant($const);
  74. }
  75. }