Compression.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\ColumnFamilyPolicy;
  5. use UnexpectedValueException;
  6. /**
  7. * Protobuf type <code>Ydb.Table.ColumnFamilyPolicy.Compression</code>
  8. */
  9. class Compression
  10. {
  11. /**
  12. * Generated from protobuf enum <code>COMPRESSION_UNSPECIFIED = 0;</code>
  13. */
  14. const COMPRESSION_UNSPECIFIED = 0;
  15. /**
  16. * Generated from protobuf enum <code>UNCOMPRESSED = 1;</code>
  17. */
  18. const UNCOMPRESSED = 1;
  19. /**
  20. * Generated from protobuf enum <code>COMPRESSED = 2;</code>
  21. */
  22. const COMPRESSED = 2;
  23. private static $valueToName = [
  24. self::COMPRESSION_UNSPECIFIED => 'COMPRESSION_UNSPECIFIED',
  25. self::UNCOMPRESSED => 'UNCOMPRESSED',
  26. self::COMPRESSED => 'COMPRESSED',
  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(Compression::class, \Ydb\Table\ColumnFamilyPolicy_Compression::class);