Mode.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_table.proto
  4. namespace Ydb\Table\ExecuteScanQueryRequest;
  5. use UnexpectedValueException;
  6. /**
  7. * Protobuf type <code>Ydb.Table.ExecuteScanQueryRequest.Mode</code>
  8. */
  9. class Mode
  10. {
  11. /**
  12. * Generated from protobuf enum <code>MODE_UNSPECIFIED = 0;</code>
  13. */
  14. const MODE_UNSPECIFIED = 0;
  15. /**
  16. * Generated from protobuf enum <code>MODE_EXPLAIN = 1;</code>
  17. */
  18. const MODE_EXPLAIN = 1;
  19. /**
  20. * MODE_PREPARE = 2;
  21. *
  22. * Generated from protobuf enum <code>MODE_EXEC = 3;</code>
  23. */
  24. const MODE_EXEC = 3;
  25. private static $valueToName = [
  26. self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED',
  27. self::MODE_EXPLAIN => 'MODE_EXPLAIN',
  28. self::MODE_EXEC => 'MODE_EXEC',
  29. ];
  30. public static function name($value)
  31. {
  32. if (!isset(self::$valueToName[$value])) {
  33. throw new UnexpectedValueException(sprintf(
  34. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  35. }
  36. return self::$valueToName[$value];
  37. }
  38. public static function value($name)
  39. {
  40. $const = __CLASS__ . '::' . strtoupper($name);
  41. if (!defined($const)) {
  42. throw new UnexpectedValueException(sprintf(
  43. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  44. }
  45. return constant($const);
  46. }
  47. }
  48. // Adding a class alias for backwards compatibility with the previous class name.
  49. class_alias(Mode::class, \Ydb\Table\ExecuteScanQueryRequest_Mode::class);