1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- # Generated by the protocol buffer compiler. DO NOT EDIT!
- # source: common.proto
- namespace Common_pack;
- use UnexpectedValueException;
- /**
- * Protobuf type <code>common_pack.roleType</code>
- */
- class roleType
- {
- /**
- * Generated from protobuf enum <code>ROLE_TYPE_UNKNOWN = 0;</code>
- */
- const ROLE_TYPE_UNKNOWN = 0;
- /**
- * 无操作
- *
- * Generated from protobuf enum <code>RED = 1;</code>
- */
- const RED = 1;
- /**
- * Generated from protobuf enum <code>BLUE = 4;</code>
- */
- const BLUE = 4;
- /**
- * Generated from protobuf enum <code>YELLOW = 3;</code>
- */
- const YELLOW = 3;
- /**
- * Generated from protobuf enum <code>GREEN = 2;</code>
- */
- const GREEN = 2;
- private static $valueToName = [
- self::ROLE_TYPE_UNKNOWN => 'ROLE_TYPE_UNKNOWN',
- self::RED => 'RED',
- self::BLUE => 'BLUE',
- self::YELLOW => 'YELLOW',
- self::GREEN => 'GREEN',
- ];
- public static function name($value)
- {
- if (!isset(self::$valueToName[$value])) {
- throw new UnexpectedValueException(sprintf(
- 'Enum %s has no name defined for value %s', __CLASS__, $value));
- }
- return self::$valueToName[$value];
- }
- public static function value($name)
- {
- $const = __CLASS__ . '::' . strtoupper($name);
- if (!defined($const)) {
- throw new UnexpectedValueException(sprintf(
- 'Enum %s has no value defined for name %s', __CLASS__, $name));
- }
- return constant($const);
- }
- }
|