OptMailType.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: mail.proto
  4. /**
  5. * Protobuf type <code>OptMailType</code>
  6. */
  7. class OptMailType
  8. {
  9. /**
  10. * Generated from protobuf enum <code>ROLE_TYPE_UNKNOWN = 0;</code>
  11. */
  12. const ROLE_TYPE_UNKNOWN = 0;
  13. /**
  14. * 查看
  15. *
  16. * Generated from protobuf enum <code>CHECK = 1;</code>
  17. */
  18. const CHECK = 1;
  19. /**
  20. *领取
  21. *
  22. * Generated from protobuf enum <code>RECEIVE = 2;</code>
  23. */
  24. const RECEIVE = 2;
  25. /**
  26. *删除
  27. *
  28. * Generated from protobuf enum <code>DELETE = 3;</code>
  29. */
  30. const DELETE = 3;
  31. private static $valueToName = [
  32. self::ROLE_TYPE_UNKNOWN => 'ROLE_TYPE_UNKNOWN',
  33. self::CHECK => 'CHECK',
  34. self::RECEIVE => 'RECEIVE',
  35. self::DELETE => 'DELETE',
  36. ];
  37. public static function name($value)
  38. {
  39. if (!isset(self::$valueToName[$value])) {
  40. throw new UnexpectedValueException(sprintf(
  41. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  42. }
  43. return self::$valueToName[$value];
  44. }
  45. public static function value($name)
  46. {
  47. $const = __CLASS__ . '::' . strtoupper($name);
  48. if (!defined($const)) {
  49. throw new UnexpectedValueException(sprintf(
  50. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  51. }
  52. return constant($const);
  53. }
  54. }