Serializer
class Serializer
Collection of methods to help with serialization of protobuf objects
Constants
MAP_KEY_FIELD_NAME |
|
MAP_VALUE_FIELD_NAME |
|
Methods
Serializer constructor.
Encode protobuf message as a PHP array
Decode PHP array into the specified protobuf message
No description
No description
Decode metadata received from gRPC status object
Decode an array of Any messages into a printable PHP array.
No description
No description
Convert string from camelCase to snake_case
Convert string from snake_case to camelCase
No description
Details
at line 76
__construct(array $fieldTransformers = [], array $messageTypeTransformers = [], array $decodeFieldTransformers = [], array $decodeMessageTypeTransformers = [])
Serializer constructor.
at line 94
array
encodeMessage(mixed $message)
Encode protobuf message as a PHP array
at line 109
mixed
decodeMessage(mixed $message, array $data)
Decode PHP array into the specified protobuf message
at line 121
static string
serializeToJson(Message $message)
at line 130
static array
serializeToPhpArray(Message $message)
at line 141
static array
decodeMetadata(array $metadata)
Decode metadata received from gRPC status object
at line 181
static array
decodeAnyMessages($anyArray)
Decode an array of Any messages into a printable PHP array.
at line 382
static string
getGetter(string $name)
at line 391
static string
getSetter(string $name)
at line 402
static string
toSnakeCase(string $key)
Convert string from camelCase to snake_case
at line 413
static string
toCamelCase(string $key)
Convert string from snake_case to camelCase