From 74e7decbbf130485a5bc5d792fb4f9285143bce3 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Thu, 30 Nov 2017 12:19:50 -0800 Subject: Provide discardUnknonwnFields API in php (#3976) * Provide discardUnknownFields API in php implementation * Provide discardUnknownFields API in php c extension. --- php/src/Google/Protobuf/Internal/Message.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'php/src') 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 @@ -576,6 +576,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. * -- cgit v1.2.3