Xcom
PHP Manual

Xcom::encode

(PECL xcommerce >= 1.0.0)

Xcom::encodeEncode an avro message

Description

public string Xcom::encode ( stdClass $data , string $avro_schema )

This method encodes a stdClass object to an avro binary encoded blob.

Liste de paramètres

data

A stdClass compatible object to encode.

avro_schema

The avro JSON schema to encode the data against.

Valeurs de retour

Returns an avro-encoded string or FALSE on failure.

Exemples

Exemple #1 Xcom::encode() example

<?php

$data 
= new stdClass();
$data->orderID "foo1234";

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

?>

Voir aussi


Xcom
PHP Manual