Unverified Commit 54288a01 authored by Paul Yang's avatar Paul Yang Committed by GitHub

Rename get/setXXXValue to get/setXXXUnwrapped (#6295)

parent b7a5772c
This diff is collapsed.
...@@ -678,14 +678,14 @@ void GenerateFieldAccessor(const FieldDescriptor* field, bool is_descriptor, ...@@ -678,14 +678,14 @@ void GenerateFieldAccessor(const FieldDescriptor* field, bool is_descriptor,
field->name()); field->name());
} }
// For wrapper types, generate an additional getXXXValue getter // For wrapper types, generate an additional getXXXUnwrapped getter
if (!field->is_map() && if (!field->is_map() &&
!field->is_repeated() && !field->is_repeated() &&
field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE && field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE &&
IsWrapperType(field)) { IsWrapperType(field)) {
GenerateWrapperFieldGetterDocComment(printer, field); GenerateWrapperFieldGetterDocComment(printer, field);
printer->Print( printer->Print(
"public function get^camel_name^Value()\n" "public function get^camel_name^Unwrapped()\n"
"{\n" "{\n"
" $wrapper = $this->get^camel_name^();\n" " $wrapper = $this->get^camel_name^();\n"
" return is_null($wrapper) ? null : $wrapper->getValue();\n" " return is_null($wrapper) ? null : $wrapper->getValue();\n"
...@@ -798,7 +798,7 @@ void GenerateFieldAccessor(const FieldDescriptor* field, bool is_descriptor, ...@@ -798,7 +798,7 @@ void GenerateFieldAccessor(const FieldDescriptor* field, bool is_descriptor,
IsWrapperType(field)) { IsWrapperType(field)) {
GenerateWrapperFieldSetterDocComment(printer, field); GenerateWrapperFieldSetterDocComment(printer, field);
printer->Print( printer->Print(
"public function set^camel_name^Value($var)\n" "public function set^camel_name^Unwrapped($var)\n"
"{\n" "{\n"
" $wrappedVar = is_null($var) ? null : new \\^wrapper_type^(['value' => $var]);\n" " $wrappedVar = is_null($var) ? null : new \\^wrapper_type^(['value' => $var]);\n"
" return $this->set^camel_name^($wrappedVar);\n" " return $this->set^camel_name^($wrappedVar);\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment