PHP Class Google\Cloud\PhpArray

Inheritance: extends DrSlump\Protobuf\Codec\PhpArray
Datei anzeigen Open project: GoogleCloudPlatform/gcloud-php

Public Methods

Method Description
__construct ( array $customFilters = [] )

Protected Methods

Method Description
decodeMessage ( DrSlump\Protobuf\Message $message, $data ) Borrowed heavily from {@see DrSlump\Protobuf\Codec\PhpArray::decodeMessage()}.
encodeMessage ( DrSlump\Protobuf\Message $message ) Borrowed heavily from {@see DrSlump\Protobuf\Codec\PhpArray::encodeMessage()}.
filterValue ( $value, DrSlump\Protobuf\Field $field )

Private Methods

Method Description
isKeyValueMessage ( $value )
toCamelCase ( $key )
toSnakeCase ( $key )

Method Details

__construct() public method

public __construct ( array $customFilters = [] )
$customFilters array A set of callbacks to apply to properties in a gRPC response.

decodeMessage() protected method

The only addition here is converting camel case field names to snake case.
protected decodeMessage ( DrSlump\Protobuf\Message $message, $data )
$message DrSlump\Protobuf\Message

encodeMessage() protected method

With this approach we are able to transform the response with minimal overhead.
protected encodeMessage ( DrSlump\Protobuf\Message $message )
$message DrSlump\Protobuf\Message

filterValue() protected method

protected filterValue ( $value, DrSlump\Protobuf\Field $field )
$field DrSlump\Protobuf\Field