1<?php 2 3// Protocol Buffers - Google's data interchange format 4// Copyright 2017 Google Inc. All rights reserved. 5// 6// Use of this source code is governed by a BSD-style 7// license that can be found in the LICENSE file or at 8// https://developers.google.com/open-source/licenses/bsd 9 10namespace Google\Protobuf; 11 12class EnumDescriptor 13{ 14 private $internal_desc; 15 16 /** 17 * @internal 18 */ 19 public function __construct($internal_desc) 20 { 21 $this->internal_desc = $internal_desc; 22 } 23 24 /** 25 * @return string Full protobuf message name 26 */ 27 public function getFullName() 28 { 29 return $this->internal_desc->getFullName(); 30 } 31 32 /** 33 * @return string PHP class name 34 */ 35 public function getClass() 36 { 37 return $this->internal_desc->getClass(); 38 } 39 40 /** 41 * @param int $index Must be >= 0 and < getValueCount() 42 * @return EnumValueDescriptor 43 */ 44 public function getValue($index) 45 { 46 return $this->internal_desc->getValueDescriptorByIndex($index); 47 } 48 49 /** 50 * @return int Number of values in enum 51 */ 52 public function getValueCount() 53 { 54 return $this->internal_desc->getValueCount(); 55 } 56} 57