Xcom::__construct
Xcom::encode
Xcom
PHP Manual

# Xcom::decode

(PECL xcommerce >= 1.0.0)

Xcom::decode — Decodes an avro message

### Opis

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

This method decodes an avro message.

### Parametry

`avro_message`

  The binary avro message to be decoded.

`json_schema`

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

### Zwracane wartości

Returns a `stdClass` object, or FALSE on failure.

### Przykłady

Przykład #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);
?>`

### Zobacz też:

- Xcom::encode() - Encode an avro message

Xcom::__construct
Xcom::encode
Xcom
PHP Manual