function Message::serializeMapFieldToStream
@ignore
1 call to Message::serializeMapFieldToStream()
- Message::serializeFieldToStream in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ Message.php - @ignore
File
-
vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ Message.php, line 1381
Class
- Message
- Parent class of all proto messages. Users should not instantiate this class or extend this class or its child classes by their own. See the comment of specific functions for more details.
Namespace
Google\Protobuf\InternalCode
private function serializeMapFieldToStream($field, $output) {
$getter = $field->getGetter();
$values = $this->{$getter}();
$count = count($values);
if ($count === 0) {
return true;
}
foreach ($values as $key => $value) {
$map_entry = new MapEntry($field->getMessageType());
$map_entry->setKey($key);
$map_entry->setValue($value);
if (!GPBWire::serializeFieldToStream($map_entry, $field, true, $output)) {
return false;
}
}
return true;
}