From a323f1e65da2c512f971a2edf1918a0cca340015 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Fri, 27 Jan 2017 13:17:54 -0800 Subject: Oneof accessor should return the field name that is actually set. (#2631) --- php/ext/google/protobuf/protobuf.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'php/ext/google/protobuf/protobuf.h') diff --git a/php/ext/google/protobuf/protobuf.h b/php/ext/google/protobuf/protobuf.h index 8022a9aa..bd01005b 100644 --- a/php/ext/google/protobuf/protobuf.h +++ b/php/ext/google/protobuf/protobuf.h @@ -237,10 +237,13 @@ zval* layout_get(MessageLayout* layout, const void* storage, const upb_fielddef* field, zval** cache TSRMLS_DC); void layout_set(MessageLayout* layout, MessageHeader* header, const upb_fielddef* field, zval* val TSRMLS_DC); +const char* layout_get_oneof_case(MessageLayout* layout, const void* storage, + const upb_oneofdef* oneof TSRMLS_DC); void free_layout(MessageLayout* layout); PHP_METHOD(Message, readOneof); PHP_METHOD(Message, writeOneof); +PHP_METHOD(Message, whichOneof); PHP_METHOD(Message, __construct); // ----------------------------------------------------------------------------- -- cgit v1.2.3