123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <?php
- # Generated by the protocol buffer compiler. DO NOT EDIT!
- # source: protos/ydb_value.proto
- namespace Ydb\Type;
- use UnexpectedValueException;
- /**
- * Protobuf type <code>Ydb.Type.PrimitiveTypeId</code>
- */
- class PrimitiveTypeId
- {
- /**
- * Generated from protobuf enum <code>PRIMITIVE_TYPE_ID_UNSPECIFIED = 0;</code>
- */
- const PRIMITIVE_TYPE_ID_UNSPECIFIED = 0;
- /**
- * Generated from protobuf enum <code>BOOL = 6;</code>
- */
- const BOOL = 6;
- /**
- * Generated from protobuf enum <code>INT8 = 7;</code>
- */
- const INT8 = 7;
- /**
- * Generated from protobuf enum <code>UINT8 = 5;</code>
- */
- const UINT8 = 5;
- /**
- * Generated from protobuf enum <code>INT16 = 8;</code>
- */
- const INT16 = 8;
- /**
- * Generated from protobuf enum <code>UINT16 = 9;</code>
- */
- const UINT16 = 9;
- /**
- * Generated from protobuf enum <code>INT32 = 1;</code>
- */
- const INT32 = 1;
- /**
- * Generated from protobuf enum <code>UINT32 = 2;</code>
- */
- const UINT32 = 2;
- /**
- * Generated from protobuf enum <code>INT64 = 3;</code>
- */
- const INT64 = 3;
- /**
- * Generated from protobuf enum <code>UINT64 = 4;</code>
- */
- const UINT64 = 4;
- /**
- * Generated from protobuf enum <code>FLOAT = 33;</code>
- */
- const FLOAT = 33;
- /**
- * Generated from protobuf enum <code>DOUBLE = 32;</code>
- */
- const DOUBLE = 32;
- /**
- * Generated from protobuf enum <code>DATE = 48;</code>
- */
- const DATE = 48;
- /**
- * Generated from protobuf enum <code>DATETIME = 49;</code>
- */
- const DATETIME = 49;
- /**
- * Generated from protobuf enum <code>TIMESTAMP = 50;</code>
- */
- const TIMESTAMP = 50;
- /**
- * Generated from protobuf enum <code>INTERVAL = 51;</code>
- */
- const INTERVAL = 51;
- /**
- * Generated from protobuf enum <code>TZ_DATE = 52;</code>
- */
- const TZ_DATE = 52;
- /**
- * Generated from protobuf enum <code>TZ_DATETIME = 53;</code>
- */
- const TZ_DATETIME = 53;
- /**
- * Generated from protobuf enum <code>TZ_TIMESTAMP = 54;</code>
- */
- const TZ_TIMESTAMP = 54;
- /**
- * Generated from protobuf enum <code>STRING = 4097;</code>
- */
- const STRING = 4097;
- /**
- * Generated from protobuf enum <code>UTF8 = 4608;</code>
- */
- const UTF8 = 4608;
- /**
- * Generated from protobuf enum <code>YSON = 4609;</code>
- */
- const YSON = 4609;
- /**
- * Generated from protobuf enum <code>JSON = 4610;</code>
- */
- const JSON = 4610;
- /**
- * Generated from protobuf enum <code>UUID = 4611;</code>
- */
- const UUID = 4611;
- /**
- * Generated from protobuf enum <code>JSON_DOCUMENT = 4612;</code>
- */
- const JSON_DOCUMENT = 4612;
- /**
- * Generated from protobuf enum <code>DYNUMBER = 4866;</code>
- */
- const DYNUMBER = 4866;
- private static $valueToName = [
- self::PRIMITIVE_TYPE_ID_UNSPECIFIED => 'PRIMITIVE_TYPE_ID_UNSPECIFIED',
- self::BOOL => 'BOOL',
- self::INT8 => 'INT8',
- self::UINT8 => 'UINT8',
- self::INT16 => 'INT16',
- self::UINT16 => 'UINT16',
- self::INT32 => 'INT32',
- self::UINT32 => 'UINT32',
- self::INT64 => 'INT64',
- self::UINT64 => 'UINT64',
- self::FLOAT => 'FLOAT',
- self::DOUBLE => 'DOUBLE',
- self::DATE => 'DATE',
- self::DATETIME => 'DATETIME',
- self::TIMESTAMP => 'TIMESTAMP',
- self::INTERVAL => 'INTERVAL',
- self::TZ_DATE => 'TZ_DATE',
- self::TZ_DATETIME => 'TZ_DATETIME',
- self::TZ_TIMESTAMP => 'TZ_TIMESTAMP',
- self::STRING => 'STRING',
- self::UTF8 => 'UTF8',
- self::YSON => 'YSON',
- self::JSON => 'JSON',
- self::UUID => 'UUID',
- self::JSON_DOCUMENT => 'JSON_DOCUMENT',
- self::DYNUMBER => 'DYNUMBER',
- ];
- 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);
- }
- }
- // Adding a class alias for backwards compatibility with the previous class name.
- class_alias(PrimitiveTypeId::class, \Ydb\Type_PrimitiveTypeId::class);
|