function OneofDescriptor::buildFromProto
1 call to OneofDescriptor::buildFromProto()
- Descriptor::buildFromProto in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ Descriptor.php
File
-
vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ OneofDescriptor.php, line 51
Class
Namespace
Google\Protobuf\InternalCode
public static function buildFromProto($oneof_proto, $desc, $index) {
$oneof = new OneofDescriptor();
$oneof->setName($oneof_proto->getName());
foreach ($desc->getField() as $field) {
/** @var FieldDescriptor $field */
if ($field->getOneofIndex() == $index) {
$oneof->addField($field);
$field->setContainingOneof($oneof);
}
}
return $oneof;
}