From 77f64bb7779ec2195f9bc4dc82497d12c18fc6b7 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Thu, 5 Oct 2017 21:03:57 -0700 Subject: Add well known types to php runtime. (#3697) * Add well known types to php runtime. * Fix php7.0 tests * No longer generate empty.proto in test as it has been included in runtime. * Fix zts build * Clean code * Rename g_p_b_empty to empty. * Don't generate code for empty.proto in compatibility test * Fix 32-bit * Fix mac build * Fix Makefile.am to add new files --- php/src/Google/Protobuf/Struct.php | 63 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 php/src/Google/Protobuf/Struct.php (limited to 'php/src/Google/Protobuf/Struct.php') diff --git a/php/src/Google/Protobuf/Struct.php b/php/src/Google/Protobuf/Struct.php new file mode 100644 index 00000000..721e991c --- /dev/null +++ b/php/src/Google/Protobuf/Struct.php @@ -0,0 +1,63 @@ +google.protobuf.Struct + */ +class Struct extends \Google\Protobuf\Internal\Message +{ + /** + * Unordered map of dynamically typed values. + * + * Generated from protobuf field map fields = 1; + */ + private $fields; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Struct::initOnce(); + parent::__construct(); + } + + /** + * Unordered map of dynamically typed values. + * + * Generated from protobuf field map fields = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getFields() + { + return $this->fields; + } + + /** + * Unordered map of dynamically typed values. + * + * Generated from protobuf field map fields = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); + $this->fields = $arr; + + return $this; + } + +} + -- cgit v1.2.3