Elastification PHP Client API
Class

Elastification\Client\Serializer\JmsSerializer

class JmsSerializer implements SerializerInterface

JMS Serializer.

In order to use this DeSer mechanism you need to register a custom handler at the build time of your Serializer instance. As this cannot be influenced after the building process has finished, you need to do it yourself.

Please have a look at the handler here {@see Elastification\Client\Serializer\JmsSerializer\SourceSubscribingHandler} and please have a look at the test here {see Elastification\Client\Tests\Unit\Serializer\JmsSerializerTest}, esp. the setUp method tells you how to register this handler. You can pass the class to use for _source serialization into the constructor of the handler class.

Constants

SERIALIZER_FORMAT

Methods

__construct(Serializer $jms)

string serialize(mixed $data, array $params = array())

Serializes given data to string

GatewayInterface deserialize(string $data, array $params = array())

Deserializes given data to array or object

SerializationContext getJmsSerializeContext()

void setJmsSerializeContext(SerializationContext $jmsContext)

DeserializationContext getJmsDeserializeContext()

void setJmsDeserializeContext(DeserializationContext $jmsDeserializeContext)

string getDeserializerClass()

void setDeserializerClass(string $deserializerClass)

Details

at line 77
public __construct(Serializer $jms)

Parameters

Serializer $jms

at line 90
public string serialize(mixed $data, array $params = array())

Serializes given data to string

Parameters

mixed $data The data to handle.
array $params The params are passed to the chosen serializer.

Return Value

string

at line 107
public GatewayInterface deserialize(string $data, array $params = array())

Deserializes given data to array or object

Parameters

string $data The data to handle.
array $params The params are passed to the chosen serializer.

Return Value

GatewayInterface

at line 146
public SerializationContext getJmsSerializeContext()

Return Value

SerializationContext

at line 157
public void setJmsSerializeContext(SerializationContext $jmsContext)

Parameters

SerializationContext $jmsContext

Return Value

void

at line 166
public DeserializationContext getJmsDeserializeContext()

Return Value

DeserializationContext

at line 177
public void setJmsDeserializeContext(DeserializationContext $jmsDeserializeContext)

Parameters

DeserializationContext $jmsDeserializeContext

Return Value

void

at line 186
public string getDeserializerClass()

Return Value

string

at line 197
public void setDeserializerClass(string $deserializerClass)

Parameters

string $deserializerClass

Return Value

void