From 9f5109b78aea6126641ade5d6887377d8badbe7d Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Thu, 4 Jan 2018 14:47:49 +0000 Subject: [PATCH] Add the `should-obfuscate=false` attribute for events --- .../Events/EventStore/Doctrine/DoctrineEventStore.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ContinuousPipe/Events/EventStore/Doctrine/DoctrineEventStore.php b/src/ContinuousPipe/Events/EventStore/Doctrine/DoctrineEventStore.php index ae84f42..0f365bb 100644 --- a/src/ContinuousPipe/Events/EventStore/Doctrine/DoctrineEventStore.php +++ b/src/ContinuousPipe/Events/EventStore/Doctrine/DoctrineEventStore.php @@ -9,6 +9,7 @@ use ContinuousPipe\Events\TimeResolver\TimeResolver; use Doctrine\ORM\EntityManager; use Doctrine\ORM\ORMException; +use JMS\Serializer\SerializationContext; use JMS\Serializer\SerializerInterface; use Ramsey\Uuid\Uuid; @@ -47,11 +48,14 @@ public function __construct( */ public function store(string $stream, $event) { + $serializationContext = SerializationContext::create(); + $serializationContext->setAttribute('should-obfuscate', false); + $dataTransferObject = new EventDto( Uuid::uuid4(), $stream, get_class($event), - $this->serializer->serialize($event, 'json'), + $this->serializer->serialize($event, 'json', $serializationContext), $this->timeResolver->resolve() );