function FileDescriptor::buildFromProto
1 call to FileDescriptor::buildFromProto()
- DescriptorPool::internalAddGeneratedFile in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ DescriptorPool.php
File
-
vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ FileDescriptor.php, line 49
Class
Namespace
Google\Protobuf\InternalCode
public static function buildFromProto($proto) {
$file = new FileDescriptor();
$file->setPackage($proto->getPackage());
foreach ($proto->getMessageType() as $message_proto) {
$file->addMessageType(Descriptor::buildFromProto($message_proto, $proto, ""));
}
foreach ($proto->getEnumType() as $enum_proto) {
$file->addEnumType(EnumDescriptor::buildFromProto($enum_proto, $proto, ""));
}
return $file;
}