Feature.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: route_guide.proto
  4. namespace Routeguide;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * A feature names something at a given point.
  10. * If a feature could not be named, the name is empty.
  11. *
  12. * Generated from protobuf message <code>routeguide.Feature</code>
  13. */
  14. class Feature extends \Google\Protobuf\Internal\Message
  15. {
  16. /**
  17. * The name of the feature.
  18. *
  19. * Generated from protobuf field <code>string name = 1;</code>
  20. */
  21. protected $name = '';
  22. /**
  23. * The point where the feature is detected.
  24. *
  25. * Generated from protobuf field <code>.routeguide.Point location = 2;</code>
  26. */
  27. protected $location = null;
  28. /**
  29. * Constructor.
  30. *
  31. * @param array $data {
  32. * Optional. Data for populating the Message object.
  33. *
  34. * @type string $name
  35. * The name of the feature.
  36. * @type \Routeguide\Point $location
  37. * The point where the feature is detected.
  38. * }
  39. */
  40. public function __construct($data = NULL) {
  41. \GPBMetadata\RouteGuide::initOnce();
  42. parent::__construct($data);
  43. }
  44. /**
  45. * The name of the feature.
  46. *
  47. * Generated from protobuf field <code>string name = 1;</code>
  48. * @return string
  49. */
  50. public function getName()
  51. {
  52. return $this->name;
  53. }
  54. /**
  55. * The name of the feature.
  56. *
  57. * Generated from protobuf field <code>string name = 1;</code>
  58. * @param string $var
  59. * @return $this
  60. */
  61. public function setName($var)
  62. {
  63. GPBUtil::checkString($var, True);
  64. $this->name = $var;
  65. return $this;
  66. }
  67. /**
  68. * The point where the feature is detected.
  69. *
  70. * Generated from protobuf field <code>.routeguide.Point location = 2;</code>
  71. * @return \Routeguide\Point|null
  72. */
  73. public function getLocation()
  74. {
  75. return isset($this->location) ? $this->location : null;
  76. }
  77. public function hasLocation()
  78. {
  79. return isset($this->location);
  80. }
  81. public function clearLocation()
  82. {
  83. unset($this->location);
  84. }
  85. /**
  86. * The point where the feature is detected.
  87. *
  88. * Generated from protobuf field <code>.routeguide.Point location = 2;</code>
  89. * @param \Routeguide\Point $var
  90. * @return $this
  91. */
  92. public function setLocation($var)
  93. {
  94. GPBUtil::checkMessage($var, \Routeguide\Point::class);
  95. $this->location = $var;
  96. return $this;
  97. }
  98. }