Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. GPBUtil.php

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

GPBUtil

Namespace

Google\Protobuf\Internal

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal