From 616e68ecc1c997c8b4c22a708cc9f6605a329bef Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Fri, 10 Mar 2017 13:42:59 -0800 Subject: Repeated/Map field setter should accept a regular PHP array (#2817) Accept regular PHP array for repeated/map setter. Existing map/repeated field will be swapped by a clean map/repeated field. Then, elements in the array will be added to the map/repeated field. All elements will be type checked before adding. See #2686 for detail. --- php/src/Google/Protobuf/Internal/MapField.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'php/src/Google/Protobuf/Internal/MapField.php') diff --git a/php/src/Google/Protobuf/Internal/MapField.php b/php/src/Google/Protobuf/Internal/MapField.php index 14ee7ebe..68c10c08 100644 --- a/php/src/Google/Protobuf/Internal/MapField.php +++ b/php/src/Google/Protobuf/Internal/MapField.php @@ -203,6 +203,30 @@ class MapField implements \ArrayAccess, \IteratorAggregate, \Countable $this->klass = $klass; } + /** + * @ignore + */ + public function getKeyType() + { + return $this->key_type; + } + + /** + * @ignore + */ + public function getValueType() + { + return $this->value_type; + } + + /** + * @ignore + */ + public function getValueClass() + { + return $this->klass; + } + /** * Return the element at the given key. * -- cgit v1.2.3