proto library Client - Class DescriptorProto (v5.36.2)

Reference documentation and code samples for the proto library Client class DescriptorProto.

Describes a message type.

Generated from protobuf message google.protobuf.DescriptorProto

Namespace

Google \ Protobuf \ Internal

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ name string
↳ field array<FieldDescriptorProto>
↳ extension array<FieldDescriptorProto>
↳ nested_type array<DescriptorProto>
↳ enum_type array<EnumDescriptorProto>
↳ extension_range array<DescriptorProto\ExtensionRange>
↳ oneof_decl array<OneofDescriptorProto>
↳ options MessageOptions
↳ reserved_range array<DescriptorProto\ReservedRange>
↳ reserved_name string[]

Reserved field names, which may not be used by fields in the same message. A given name may only be reserved once.

↳ visibility int

Support for export and local keywords on enums.

getName

Generated from protobuf field optional string name = 1;

Returns
Type Description
string

hasName

clearName

setName

Generated from protobuf field optional string name = 1;

Parameter
Name Description
var string
Returns
Type Description
$this

getField

Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto field = 2;

Returns
Type Description
Google\Protobuf\RepeatedField<FieldDescriptorProto>

setField

Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto field = 2;

Parameter
Name Description
var array<FieldDescriptorProto>
Returns
Type Description
$this

getExtension

Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 6;

Returns
Type Description
Google\Protobuf\RepeatedField<FieldDescriptorProto>

setExtension

Generated from protobuf field repeated .google.protobuf.FieldDescriptorProto extension = 6;

Parameter
Name Description
var array<FieldDescriptorProto>
Returns
Type Description
$this

getNestedType

Generated from protobuf field repeated .google.protobuf.DescriptorProto nested_type = 3;

Returns
Type Description
Google\Protobuf\RepeatedField<DescriptorProto>

setNestedType

Generated from protobuf field repeated .google.protobuf.DescriptorProto nested_type = 3;

Parameter
Name Description
var array<DescriptorProto>
Returns
Type Description
$this

getEnumType

Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 4;

Returns
Type Description
Google\Protobuf\RepeatedField<EnumDescriptorProto>

setEnumType

Generated from protobuf field repeated .google.protobuf.EnumDescriptorProto enum_type = 4;

Parameter
Name Description
var array<EnumDescriptorProto>
Returns
Type Description
$this

getExtensionRange

Generated from protobuf field repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;

Returns
Type Description
Google\Protobuf\RepeatedField<DescriptorProto\ExtensionRange>

setExtensionRange

Generated from protobuf field repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;

Parameter
Name Description
var array<DescriptorProto\ExtensionRange>
Returns
Type Description
$this

getOneofDecl

Generated from protobuf field repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;

Returns
Type Description
Google\Protobuf\RepeatedField<OneofDescriptorProto>

setOneofDecl

Generated from protobuf field repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;

Parameter
Name Description
var array<OneofDescriptorProto>
Returns
Type Description
$this

getOptions

Generated from protobuf field optional .google.protobuf.MessageOptions options = 7;

Returns
Type Description
MessageOptions|null

hasOptions

clearOptions

setOptions

Generated from protobuf field optional .google.protobuf.MessageOptions options = 7;

Parameter
Name Description
var MessageOptions
Returns
Type Description
$this

getReservedRange

Generated from protobuf field repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;

Returns
Type Description
Google\Protobuf\RepeatedField<DescriptorProto\ReservedRange>

setReservedRange

Generated from protobuf field repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;

Parameter
Name Description
var array<DescriptorProto\ReservedRange>
Returns
Type Description
$this

getReservedName

Reserved field names, which may not be used by fields in the same message.

A given name may only be reserved once.

Returns
Type Description
Google\Protobuf\RepeatedField<string>

setReservedName

Reserved field names, which may not be used by fields in the same message.

A given name may only be reserved once.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getVisibility

Support for export and local keywords on enums.

Returns
Type Description
int one of the values in {@see \Google\Protobuf\Internal\SymbolVisibility}

hasVisibility

clearVisibility

setVisibility

Support for export and local keywords on enums.

Parameter
Name Description
var int

one of the values in SymbolVisibility

Returns
Type Description
$this