Sf TIC Bundles

SerializedTransformer
in package
implements DataTransformerInterface

Transforms between a serialized data (string) and a data structure (mixed).

Example: store a complex data (form compound) into a simple database column (varchar)

Table of Contents

Interfaces

DataTransformerInterface

Properties

$type  : mixed

Methods

__construct()  : mixed
Construct the data transformer with parameters (type of serialization).
reverseTransform()  : string
Transforms a data structure into a serialization string.
transform()  : mixed
Transforms a serialization string into a data structure.

Properties

Methods

__construct()

Construct the data transformer with parameters (type of serialization).

public __construct([string $type = null ]) : mixed
Parameters
$type : string = null

Type of serialization method: json | serialize (default)

reverseTransform()

Transforms a data structure into a serialization string.

public reverseTransform([mixed $values = null ]) : string
Parameters
$values : mixed = null

Data structure (array, object, scalar...)

Return values
string

Data serialized (all values into one string)

transform()

Transforms a serialization string into a data structure.

public transform([string $values = null ]) : mixed
Parameters
$values : string = null

Data serialized (all values into one string)

Tags
throws
TransformationFailedException

If the given value is not a serialization.

Return values
mixed

Data structure (array, object, scalar...)


        
On this page

Search results