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 \ ApiCoreMethods
__construct
Serializer constructor.
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
message
mixed
array
decodeMessage
Decode PHP array into the specified protobuf message
message
mixed
data
array
mixed
static::serializeToJson
string
static::serializeToPhpArray
array
static::decodeMetadata
Decode metadata received from gRPC status object
metadata
array
array
static::decodeAnyMessages
Decode an array of Any messages into a printable PHP array.
anyArray
iterable
array
static::getGetter
name
string
string
static::getSetter
name
string
string
static::toSnakeCase
Convert string from camelCase to snake_case
key
string
string
static::toCamelCase
Convert string from snake_case to camelCase
key
string
string
static::loadKnownMetadataTypes
Constants
MAP_KEY_FIELD_NAME
Value: 'key'
MAP_VALUE_FIELD_NAME
Value: 'value'