Elastification PHP Client API
Interface

Elastification\Client\Serializer\SerializerInterface

interface SerializerInterface

Interface SerializerInterface

Methods

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.

Details

at line 39
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 57
public GatewayInterface deserialize(string $data, array $params = array())

Deserializes given data to array or object.

The response will be a {see GatewayInterface}, which enables you to use any response like an array, because the gateway interface extends from {see \ArrayAccess}. It must also implement {see \Countable} and {see \Iteratable}.

The gateway will provide a method to get the original value behind the gateway. This is what you want if you need to work with the real result.

Parameters

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

Return Value

GatewayInterface