Menu

Prooph Snapshot Serializer

Recently version many of prooph's components were updated to a new mayor release. One of its components is the prooph/snapshot-store able to serialize, and persist aggregates so they do not have to be reconstituted from the event stream when they are needed again.

A missing feature was the ability to use a different serializer/deserializer. It turned out to be relatively simple to implement it in such a way with backward compatible. All you have to do to change the following;

A default Serializer is implemented as CallbackSerializer which will use the build-on serialize/unserialize method of PHP. Simply instantiate it with different callbacks to change it's default behavior.