Grpc\AbstractCall::serializeMessage PHP Method

serializeMessage() protected method

Serialize a message to the protobuf binary format.
protected serializeMessage ( mixed $data ) : string
$data mixed The Protobuf message
return string The protobuf binary format
    protected function serializeMessage($data)
    {
        // Proto3 implementation
        if (method_exists($data, 'encode')) {
            return $data->encode();
        }
        // Protobuf-PHP implementation
        return $data->serialize();
    }