Status.php 1.6 KB

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