Skip to content
This repository has been archived by the owner on May 29, 2018. It is now read-only.

Setterfordata #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
1 change: 1 addition & 0 deletions src/php_method.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ void PHPFileGenerator::PrintSetterGetterMethods(const Descriptor& message) {
printer_.Print("\n");

printer_.Print(variables,
"public function set`oneof_capitalized_name`($value, $case) { $this->`oneof_case` = $case; $this->`oneof_name` = $value; }\n"
"public function clear`oneof_capitalized_name`() { $this->`oneof_case` = `oneof_default`; $this->`oneof_name` = null; }\n"
"public function has`oneof_capitalized_name`()`bool_return_type` { return $this->`oneof_case` !== `oneof_default`; }\n"
"public function get`oneof_capitalized_name`() { if($this->`oneof_case` !== `oneof_default`) return $this->`oneof_name`; else return null; }\n"
Expand Down