Skip to content


Serializers take objects that implement the Persistable interface and convert them into blobs of data called encodings. Encodings can then be used to either store an object or to reinstantiate an object from storage.


To serialize a persistable object into an encoding:

public serialize(Persistable $persistable) : Encoding

$encoding = $serializer->serialize($persistable);


To deserialize a persistable object from an encoding:

public deserialize(Encoding $encoding) : Persistable

$persistable = $serializer->deserialize($encoding);