diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2017-03-10 13:42:59 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-10 13:42:59 -0800 |
commit | 616e68ecc1c997c8b4c22a708cc9f6605a329bef (patch) | |
tree | 423b87d463238652d667bedd4791314d869045e0 /php/src/Google/Protobuf/Internal/MapField.php | |
parent | a1bb147e96b6f74db6cdf3c3fcb00492472dbbfa (diff) | |
download | protobuf-616e68ecc1c997c8b4c22a708cc9f6605a329bef.tar.gz protobuf-616e68ecc1c997c8b4c22a708cc9f6605a329bef.tar.bz2 protobuf-616e68ecc1c997c8b4c22a708cc9f6605a329bef.zip |
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.
Diffstat (limited to 'php/src/Google/Protobuf/Internal/MapField.php')
-rw-r--r-- | php/src/Google/Protobuf/Internal/MapField.php | 24 |
1 files changed, 24 insertions, 0 deletions
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 @@ -204,6 +204,30 @@ class MapField implements \ArrayAccess, \IteratorAggregate, \Countable } /** + * @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. * * This will also be called for: $ele = $arr[$key] |