Copied!

Describes a complete .proto file.

Generated from protobuf message google.protobuf.FileDescriptorProto

CloneableInstantiable
Methods
public __construct( $data = NULL)
 

Constructor.

  • param array $data { Optional. Data for populating the Message object.
    @type string $name
          file name, relative to root of source tree
    @type string $package
          e.g. "foo", "foo.bar", etc.
    @type string[] $dependency
          Names of files imported by this file.
    @type int[] $public_dependency
          Indexes of the public imported files in the dependency list above.
    @type int[] $weak_dependency
          Indexes of the weak imported files in the dependency list.
          For Google-internal migration only. Do not use.
    @type string[] $option_dependency
          Names of files imported by this file purely for the purpose of providing
          option extensions. These are excluded from the dependency list above.
    @type \Google\Protobuf\Internal\DescriptorProto[] $message_type
          All top-level definitions in this file.
    @type \Google\Protobuf\Internal\EnumDescriptorProto[] $enum_type
    @type \Google\Protobuf\Internal\ServiceDescriptorProto[] $service
    @type \Google\Protobuf\Internal\FieldDescriptorProto[] $extension
    @type \Google\Protobuf\Internal\FileOptions $options
    @type \Google\Protobuf\Internal\SourceCodeInfo $source_code_info
          This field contains optional information about the original source code.
          You may safely remove this entire field without harming runtime
          functionality of the descriptors -- the information is needed only by
          development tools.
    @type string $syntax
          The syntax of the proto file.
          The supported values are "proto2", "proto3", and "editions".
          If `edition` is present, this value must be "editions".
          WARNING: This field should only be used by protobuf plugins or special
          cases like the proto compiler. Other uses are discouraged and
          developers should rely on the protoreflect APIs for their client language.
    @type int $edition
          The edition of the proto file.
          WARNING: This field should only be used by protobuf plugins or special
          cases like the proto compiler. Other uses are discouraged and
          developers should rely on the protoreflect APIs for their client language.
    
    }
public Google\Protobuf\Internal\Message::__debugInfo()
public Google\Protobuf\Internal\Message::byteSize()
 
  • ignore
public Google\Protobuf\Internal\Message::clear()
 

Clear all containing fields.

  • return null
public clearEdition()
public clearName()
public clearOptions()
public clearPackage()
public clearSourceCodeInfo()
public clearSyntax()
public Google\Protobuf\Internal\Message::discardUnknownFields()
 

Clear all unknown fields previously parsed.

  • return null
public getDependency()
 

Names of files imported by this file.

Generated from protobuf field repeated string dependency = 3;

  • return \RepeatedField<string>
public getEdition()
 

The edition of the proto file.

WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language.

Generated from protobuf field optional .google.protobuf.Edition edition = 14;

  • return int one of the values in {@see \Google\Protobuf\Internal\Edition}
public getEnumType()
 

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

  • return \RepeatedField<\Google\Protobuf\Internal\EnumDescriptorProto>
public getExtension()
 

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

  • return \RepeatedField<\Google\Protobuf\Internal\FieldDescriptorProto>
public getMessageType()
 

All top-level definitions in this file.

Generated from protobuf field repeated .google.protobuf.DescriptorProto message_type = 4;

  • return \RepeatedField<\Google\Protobuf\Internal\DescriptorProto>
public getName()
 

file name, relative to root of source tree

Generated from protobuf field optional string name = 1;

  • return string
public getOptionDependency()
 

Names of files imported by this file purely for the purpose of providing option extensions. These are excluded from the dependency list above.

Generated from protobuf field repeated string option_dependency = 15;

  • return \RepeatedField<string>
public getOptions()
 

Generated from protobuf field optional .google.protobuf.FileOptions options = 8;

  • return \Google\Protobuf\Internal\FileOptions|null
public getPackage()
 

e.g. "foo", "foo.bar", etc.

Generated from protobuf field optional string package = 2;

  • return string
public getPublicDependency()
 

Indexes of the public imported files in the dependency list above.

Generated from protobuf field repeated int32 public_dependency = 10;

  • return \RepeatedField<int>
public getService()
 

Generated from protobuf field repeated .google.protobuf.ServiceDescriptorProto service = 6;

  • return \RepeatedField<\Google\Protobuf\Internal\ServiceDescriptorProto>
public getSourceCodeInfo()
 

This field contains optional information about the original source code.

You may safely remove this entire field without harming runtime functionality of the descriptors -- the information is needed only by development tools.

Generated from protobuf field optional .google.protobuf.SourceCodeInfo source_code_info = 9;

  • return \Google\Protobuf\Internal\SourceCodeInfo|null
public getSyntax()
 

The syntax of the proto file.

The supported values are "proto2", "proto3", and "editions". If edition is present, this value must be "editions". WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language.

Generated from protobuf field optional string syntax = 12;

  • return string
public getWeakDependency()
 

Indexes of the weak imported files in the dependency list.

For Google-internal migration only. Do not use.

Generated from protobuf field repeated int32 weak_dependency = 11;

  • return \RepeatedField<int>
public hasEdition()
public hasName()
public hasOptions()
public hasPackage()
public hasSourceCodeInfo()
public hasSyntax()
public Google\Protobuf\Internal\Message::jsonByteSize( $options = 0)
 
  • ignore
public Google\Protobuf\Internal\Message::mergeFrom( $msg)
 

Merges the contents of the specified message into current message.

This method merges the contents of the specified message into the current message. Singular fields that are set in the specified message overwrite the corresponding fields in the current message. Repeated fields are appended. Map fields key-value pairs are overwritten. Singular/Oneof sub-messages are recursively merged. All overwritten sub-messages are deep-copied.

  • param object $msg Protobuf message to be merged from.
  • return null
public Google\Protobuf\Internal\Message::mergeFromJsonString( $data, $ignore_unknown = false)
 

Parses a json string to protobuf message.

This function takes a string in the json wire format, matching the encoding output by serializeToJsonString(). See mergeFrom() for merging behavior, if the field is already set in the specified message.

  • param string $data Json protobuf data.
  • param bool $ignore_unknown
  • return null
  • throws \Exception Invalid data.
public Google\Protobuf\Internal\Message::mergeFromString( $data)
 

Parses a protocol buffer contained in a string.

This function takes a string in the (non-human-readable) binary wire format, matching the encoding output by serializeToString(). See mergeFrom() for merging behavior, if the field is already set in the specified message.

  • param string $data Binary protobuf data.
  • return null
  • throws \Exception Invalid data.
public Google\Protobuf\Internal\Message::parseFromJsonStream( $input, $ignore_unknown)
 
  • ignore
public Google\Protobuf\Internal\Message::parseFromStream( $input)
 
  • ignore
public Google\Protobuf\Internal\Message::serializeToJsonStream( $output)
 
  • ignore
public Google\Protobuf\Internal\Message::serializeToJsonString( $options = 0)
 

Serialize the message to json string.

  • return string Serialized json protobuf data.
public Google\Protobuf\Internal\Message::serializeToStream( $output)
 
  • ignore
public Google\Protobuf\Internal\Message::serializeToString()
 

Serialize the message to string.

  • return string Serialized binary protobuf data.
public setDependency(Google\Protobuf\RepeatedField|array $var)
 

Names of files imported by this file.

Generated from protobuf field repeated string dependency = 3;

  • param string[] $var
  • return $this
public setEdition(int $var)
 

The edition of the proto file.

WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language.

Generated from protobuf field optional .google.protobuf.Edition edition = 14;

  • param int $var one of the values in {@see \Google\Protobuf\Internal\Edition}
  • return $this
public setEnumType(Google\Protobuf\RepeatedField|array $var)
 

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

  • param \Google\Protobuf\Internal\EnumDescriptorProto[] $var
  • return $this
public setExtension(Google\Protobuf\RepeatedField|array $var)
 

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

  • param \Google\Protobuf\Internal\FieldDescriptorProto[] $var
  • return $this
public setMessageType(Google\Protobuf\RepeatedField|array $var)
 

All top-level definitions in this file.

Generated from protobuf field repeated .google.protobuf.DescriptorProto message_type = 4;

  • param \Google\Protobuf\Internal\DescriptorProto[] $var
  • return $this
public setName(string $var)
 

file name, relative to root of source tree

Generated from protobuf field optional string name = 1;

  • param string $var
  • return $this
public setOptionDependency(Google\Protobuf\RepeatedField|array $var)
 

Names of files imported by this file purely for the purpose of providing option extensions. These are excluded from the dependency list above.

Generated from protobuf field repeated string option_dependency = 15;

  • param string[] $var
  • return $this
public setOptions(?Google\Protobuf\Internal\FileOptions $var)
 

Generated from protobuf field optional .google.protobuf.FileOptions options = 8;

  • param \Google\Protobuf\Internal\FileOptions $var
  • return $this
public setPackage(string $var)
 

e.g. "foo", "foo.bar", etc.

Generated from protobuf field optional string package = 2;

  • param string $var
  • return $this
public setPublicDependency(Google\Protobuf\RepeatedField|array $var)
 

Indexes of the public imported files in the dependency list above.

Generated from protobuf field repeated int32 public_dependency = 10;

  • param int[] $var
  • return $this
public setService(Google\Protobuf\RepeatedField|array $var)
 

Generated from protobuf field repeated .google.protobuf.ServiceDescriptorProto service = 6;

  • param \Google\Protobuf\Internal\ServiceDescriptorProto[] $var
  • return $this
public setSourceCodeInfo(?Google\Protobuf\Internal\SourceCodeInfo $var)
 

This field contains optional information about the original source code.

You may safely remove this entire field without harming runtime functionality of the descriptors -- the information is needed only by development tools.

Generated from protobuf field optional .google.protobuf.SourceCodeInfo source_code_info = 9;

  • param \Google\Protobuf\Internal\SourceCodeInfo $var
  • return $this
public setSyntax(string $var)
 

The syntax of the proto file.

The supported values are "proto2", "proto3", and "editions". If edition is present, this value must be "editions". WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language.

Generated from protobuf field optional string syntax = 12;

  • param string $var
  • return $this
public setWeakDependency(Google\Protobuf\RepeatedField|array $var)
 

Indexes of the weak imported files in the dependency list.

For Google-internal migration only. Do not use.

Generated from protobuf field repeated int32 weak_dependency = 11;

  • param int[] $var
  • return $this
Properties
protected $edition = NULL
 

The edition of the proto file.

WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language.

Generated from protobuf field optional .google.protobuf.Edition edition = 14;

protected $name = NULL
 

file name, relative to root of source tree

Generated from protobuf field optional string name = 1;

protected $options = NULL
 

Generated from protobuf field optional .google.protobuf.FileOptions options = 8;

protected $package = NULL
 

e.g. "foo", "foo.bar", etc.

Generated from protobuf field optional string package = 2;

protected $source_code_info = NULL
 

This field contains optional information about the original source code.

You may safely remove this entire field without harming runtime functionality of the descriptors -- the information is needed only by development tools.

Generated from protobuf field optional .google.protobuf.SourceCodeInfo source_code_info = 9;

protected $syntax = NULL
 

The syntax of the proto file.

The supported values are "proto2", "proto3", and "editions". If edition is present, this value must be "editions". WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language.

Generated from protobuf field optional string syntax = 12;

Methods
protected Google\Protobuf\Internal\Message::hasOneof( $number)
protected Google\Protobuf\Internal\Message::mergeFromArray(array $array)
 

Populates the message from a user-supplied PHP array. Array keys correspond to Message properties and nested message properties.

Example:

$message->mergeFromArray([
    'name' => 'This is a message name',
    'interval' => [
         'startTime' => time() - 60,
         'endTime' => time(),
    ]
]);

This method will trigger an error if it is passed data that cannot be converted to the correct type. For example, a StringValue field must receive data that is either a string or a StringValue object.

  • param array $array An array containing message properties and values.
  • return null
protected Google\Protobuf\Internal\Message::mergeFromJsonArray( $array, $ignore_unknown)
protected Google\Protobuf\Internal\Message::readOneof( $number)
protected Google\Protobuf\Internal\Message::readWrapperValue( $member)
protected Google\Protobuf\Internal\Message::whichOneof( $oneof_name)
protected Google\Protobuf\Internal\Message::writeOneof( $number, $value)
protected Google\Protobuf\Internal\Message::writeWrapperValue( $member, $value)
Properties
private $dependency = NULL
 

Names of files imported by this file.

Generated from protobuf field repeated string dependency = 3;

private $enum_type = NULL
 

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

private $extension = NULL
 

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

private $message_type = NULL
 

All top-level definitions in this file.

Generated from protobuf field repeated .google.protobuf.DescriptorProto message_type = 4;

private $option_dependency = NULL
 

Names of files imported by this file purely for the purpose of providing option extensions. These are excluded from the dependency list above.

Generated from protobuf field repeated string option_dependency = 15;

private $public_dependency = NULL
 

Indexes of the public imported files in the dependency list above.

Generated from protobuf field repeated int32 public_dependency = 10;

private $service = NULL
 

Generated from protobuf field repeated .google.protobuf.ServiceDescriptorProto service = 6;

private $weak_dependency = NULL
 

Indexes of the weak imported files in the dependency list.

For Google-internal migration only. Do not use.

Generated from protobuf field repeated int32 weak_dependency = 11;

© 2026 Bruce Wells
Search Namespaces \ Classes
Configuration