aboutsummaryrefslogtreecommitdiff
path: root/php/src
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2017-11-30 12:19:50 -0800
committerGitHub <noreply@github.com>2017-11-30 12:19:50 -0800
commit74e7decbbf130485a5bc5d792fb4f9285143bce3 (patch)
tree69cfe486e2d69ecaf340b184f0b75651cfe57b43 /php/src
parentcf65a7946fb42e941708d10adbce69924c6d1ee0 (diff)
downloadprotobuf-74e7decbbf130485a5bc5d792fb4f9285143bce3.tar.gz
protobuf-74e7decbbf130485a5bc5d792fb4f9285143bce3.tar.bz2
protobuf-74e7decbbf130485a5bc5d792fb4f9285143bce3.zip
Provide discardUnknonwnFields API in php (#3976)
* Provide discardUnknownFields API in php implementation * Provide discardUnknownFields API in php c extension.
Diffstat (limited to 'php/src')
-rw-r--r--php/src/Google/Protobuf/Internal/Message.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/php/src/Google/Protobuf/Internal/Message.php b/php/src/Google/Protobuf/Internal/Message.php
index a7a4f272..26d20575 100644
--- a/php/src/Google/Protobuf/Internal/Message.php
+++ b/php/src/Google/Protobuf/Internal/Message.php
@@ -577,6 +577,15 @@ class Message
}
/**
+ * Clear all unknown fields previously parsed.
+ * @return null.
+ */
+ public function discardUnknownFields()
+ {
+ $this->unknown = "";
+ }
+
+ /**
* Merges the contents of the specified message into current message.
*
* This method merges the contents of the specified message into the