function GPBUtil::formatFieldMask
2 calls to GPBUtil::formatFieldMask()
- Message::jsonByteSize in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ Message.php - @ignore
- Message::serializeToJsonStream in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ Message.php - @ignore
File
-
vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ GPBUtil.php, line 579
Class
Namespace
Google\Protobuf\InternalCode
public static function formatFieldMask($field_mask) {
$converted_paths = [];
foreach ($field_mask->getPaths() as $path) {
$fields = explode('.', $path);
$converted_path = [];
foreach ($fields as $field) {
$segments = explode('_', $field);
$start = true;
$converted_segments = "";
foreach ($segments as $segment) {
if (!$start) {
$converted = ucfirst($segment);
}
else {
$converted = $segment;
$start = false;
}
$converted_segments .= $converted;
}
$converted_path[] = $converted_segments;
}
$converted_path = implode(".", $converted_path);
$converted_paths[] = $converted_path;
}
return implode(",", $converted_paths);
}