Exemplo n.º 1
0
 public function deserialize(SerializedObjectInterface $data)
 {
     try {
         return $this->serializer->deserialize($data->getData(), $data->getContentType(), 'json');
     } catch (\Exception $ex) {
         throw new UnknownSerializedTypeException($data->getType(), $ex);
     }
 }
Exemplo n.º 2
0
 /**
  * Initialize an Event entry for the given <code>event</code>.
  *
  * @param string $type     The type identifier of the aggregate root the event belongs to
  * @param DomainEventMessageInterface $event    The event to store in the EventStore
  * @param SerializedObjectInterface $payload  The serialized payload of the Event
  * @param SerializedObjectInterface $metaData The serialized metaData of the Event
  */
 public function __construct($type, DomainEventMessageInterface $event, SerializedObjectInterface $payload, SerializedObjectInterface $metaData)
 {
     $this->eventIdentifier = $event->getIdentifier();
     $this->type = $type;
     //$this->payloadType = $payload->getContentType();
     $this->payloadType = $payload->getType()->getName();
     $this->payloadRevision = $payload->getType()->getRevision();
     $this->payload = $payload->getData();
     $this->aggregateIdentifier = $event->getAggregateIdentifier();
     $this->scn = $event->getScn();
     $this->metaData = $metaData->getData();
     $this->timestamp = $event->getTimestamp();
 }