Mode.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_table.proto
  4. namespace Ydb\Table\ChangefeedMode;
  5. use UnexpectedValueException;
  6. /**
  7. * Protobuf type <code>Ydb.Table.ChangefeedMode.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. * Only the key component of the modified row
  17. *
  18. * Generated from protobuf enum <code>MODE_KEYS_ONLY = 1;</code>
  19. */
  20. const MODE_KEYS_ONLY = 1;
  21. /**
  22. * Updated columns
  23. *
  24. * Generated from protobuf enum <code>MODE_UPDATES = 2;</code>
  25. */
  26. const MODE_UPDATES = 2;
  27. /**
  28. * The entire row, as it appears after it was modified
  29. *
  30. * Generated from protobuf enum <code>MODE_NEW_IMAGE = 3;</code>
  31. */
  32. const MODE_NEW_IMAGE = 3;
  33. /**
  34. * The entire row, as it appeared before it was modified
  35. *
  36. * Generated from protobuf enum <code>MODE_OLD_IMAGE = 4;</code>
  37. */
  38. const MODE_OLD_IMAGE = 4;
  39. /**
  40. * Both new and old images of the row
  41. *
  42. * Generated from protobuf enum <code>MODE_NEW_AND_OLD_IMAGES = 5;</code>
  43. */
  44. const MODE_NEW_AND_OLD_IMAGES = 5;
  45. private static $valueToName = [
  46. self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED',
  47. self::MODE_KEYS_ONLY => 'MODE_KEYS_ONLY',
  48. self::MODE_UPDATES => 'MODE_UPDATES',
  49. self::MODE_NEW_IMAGE => 'MODE_NEW_IMAGE',
  50. self::MODE_OLD_IMAGE => 'MODE_OLD_IMAGE',
  51. self::MODE_NEW_AND_OLD_IMAGES => 'MODE_NEW_AND_OLD_IMAGES',
  52. ];
  53. public static function name($value)
  54. {
  55. if (!isset(self::$valueToName[$value])) {
  56. throw new UnexpectedValueException(sprintf(
  57. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  58. }
  59. return self::$valueToName[$value];
  60. }
  61. public static function value($name)
  62. {
  63. $const = __CLASS__ . '::' . strtoupper($name);
  64. if (!defined($const)) {
  65. throw new UnexpectedValueException(sprintf(
  66. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  67. }
  68. return constant($const);
  69. }
  70. }
  71. // Adding a class alias for backwards compatibility with the previous class name.
  72. class_alias(Mode::class, \Ydb\Table\ChangefeedMode_Mode::class);