State.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_table.proto
  4. namespace Ydb\Table\ChangefeedDescription;
  5. use UnexpectedValueException;
  6. /**
  7. * Protobuf type <code>Ydb.Table.ChangefeedDescription.State</code>
  8. */
  9. class State
  10. {
  11. /**
  12. * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
  13. */
  14. const STATE_UNSPECIFIED = 0;
  15. /**
  16. * Generated from protobuf enum <code>STATE_ENABLED = 1;</code>
  17. */
  18. const STATE_ENABLED = 1;
  19. /**
  20. * Generated from protobuf enum <code>STATE_DISABLED = 2;</code>
  21. */
  22. const STATE_DISABLED = 2;
  23. private static $valueToName = [
  24. self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
  25. self::STATE_ENABLED => 'STATE_ENABLED',
  26. self::STATE_DISABLED => 'STATE_DISABLED',
  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. }
  46. // Adding a class alias for backwards compatibility with the previous class name.
  47. class_alias(State::class, \Ydb\Table\ChangefeedDescription_State::class);