roomMode.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: common.proto
  4. namespace Common_pack;
  5. use UnexpectedValueException;
  6. /**
  7. * Protobuf type <code>common_pack.roomMode</code>
  8. */
  9. class roomMode
  10. {
  11. /**
  12. * Generated from protobuf enum <code>ROOM_MODE_UNKNOWN = 0;</code>
  13. */
  14. const ROOM_MODE_UNKNOWN = 0;
  15. /**
  16. * Generated from protobuf enum <code>REN_JI = 1;</code>
  17. */
  18. const REN_JI = 1;
  19. /**
  20. * Generated from protobuf enum <code>WAN_JIA = 2;</code>
  21. */
  22. const WAN_JIA = 2;
  23. private static $valueToName = [
  24. self::ROOM_MODE_UNKNOWN => 'ROOM_MODE_UNKNOWN',
  25. self::REN_JI => 'REN_JI',
  26. self::WAN_JIA => 'WAN_JIA',
  27. ];
  28. public static function name($value)
  29. {
  30. if (!isset(self::$valueToName[$value])) {
  31. throw new UnexpectedValueException(sprintf(
  32. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  33. }
  34. return self::$valueToName[$value];
  35. }
  36. public static function value($name)
  37. {
  38. $const = __CLASS__ . '::' . strtoupper($name);
  39. if (!defined($const)) {
  40. throw new UnexpectedValueException(sprintf(
  41. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  42. }
  43. return constant($const);
  44. }
  45. }