aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/src/Google/Protobuf/Internal/MapField.php
diff options
context:
space:
mode:
authorGravatar Paul Yang <TeBoring@users.noreply.github.com>2017-03-10 13:42:59 -0800
committerGravatar GitHub <noreply@github.com>2017-03-10 13:42:59 -0800
commit616e68ecc1c997c8b4c22a708cc9f6605a329bef (patch)
tree423b87d463238652d667bedd4791314d869045e0 /php/src/Google/Protobuf/Internal/MapField.php
parenta1bb147e96b6f74db6cdf3c3fcb00492472dbbfa (diff)
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.php24
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]