Xcom
PHP Manual

Xcom::decode

(PHP 5 >= Unknown)

Xcom::decodeDecodes an avro message

Description

public object Xcom::decode ( string $avro_msg , string $json_schema )

This method decodes an avro message.

Parameters

avro_message

The binary avro message to be decoded.

json_schema

The avro JSON schema (avpr) to be used in decoding the message.

Return Values

Returns a stdClass object, or FALSE on failure.

Examples

Example #1 Xcom::decode() example

<?php

$schema 
file_get_contents('http://api.x.com/ocl/com.x.example.v1/OrderFulfillment/OrderShipped/1.2.0/');
$xcom = new Xcom();
$xcom->decode(file_get_contents('php://input'), $schema);

?>

See Also


Xcom
PHP Manual