Skip to content

Commit

Permalink
Add the should-obfuscate=false attribute for events
Browse files Browse the repository at this point in the history
  • Loading branch information
sroze committed Jan 4, 2018
1 parent 603f3a2 commit 9f5109b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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()
);

Expand Down

0 comments on commit 9f5109b

Please sign in to comment.