Some or all of the information on this page might not apply to Trusted Cloud by S3NS.
Google API Core Client - Class Serializer (1.36.1)
Note: Some or all of the information on this page might not apply
to Trusted Cloud. For a list of services that are available in
Trusted Cloud, see Services available for
Trusted Cloud .
Version latestkeyboard_arrow_down
Reference documentation and code samples for the Google API Core Client class Serializer.
Collection of methods to help with serialization of protobuf objects
Namespace
Google \ ApiCore
Methods
__construct
Parameters
Name
Description
fieldTransformers
array
An array mapping field names to transformation functions
messageTypeTransformers
array
An array mapping message names to transformation functions
decodeFieldTransformers
array
An array mapping field names to transformation functions
decodeMessageTypeTransformers
array
An array mapping message names to transformation functions
customEncoders
mixed
encodeMessage
Encode protobuf message as a PHP array
Parameter
Name
Description
message
mixed
Returns
Type
Description
array
decodeMessage
Decode PHP array into the specified protobuf message
Parameters
Name
Description
message
mixed
data
array
Returns
Type
Description
mixed
static::serializeToJson
Returns
Type
Description
string
Json representation of $message
static::serializeToPhpArray
Returns
Type
Description
array
PHP array representation of $message
Decode metadata received from gRPC status object
Parameter
Name
Description
metadata
array
Returns
Type
Description
array
static::decodeAnyMessages
Decode an array of Any messages into a printable PHP array.
Parameter
Name
Description
anyArray
iterable
Returns
Type
Description
array
static::getGetter
Parameter
Name
Description
name
string
Returns
Type
Description
string
Getter function
static::getSetter
Parameter
Name
Description
name
string
Returns
Type
Description
string
Setter function
static::toSnakeCase
Convert string from camelCase to snake_case
Parameter
Name
Description
key
string
Returns
Type
Description
string
static::toCamelCase
Convert string from snake_case to camelCase
Parameter
Name
Description
key
string
Returns
Type
Description
string
Constants
MAP_KEY_FIELD_NAME
MAP_VALUE_FIELD_NAME
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-02 UTC."],[],[]]