Пример #1
0
 /**
  * @inheritdoc
  */
 public function save(Snapshot $snapshot)
 {
     $data = ['version' => $snapshot->getVersion(), 'created_at' => $snapshot->getCreatedAt()->format('U.u'), 'snapshot' => ['type' => $snapshot->getType(), 'payload' => $this->serializer->serialize($snapshot->getAggregate(), 'json')]];
     $this->redis->hset(static::KEY_NAMESPACE, (string) $snapshot->getAggregateId(), $this->serializer->serialize($data, 'json'));
 }
Пример #2
0
 private function createEventData(Snapshot $snapshot)
 {
     return ['aggregate_id' => $snapshot->getAggregateId(), 'version' => $snapshot->getVersion(), 'created_at' => $snapshot->getCreatedAt()->getTimestamp(), 'type' => $snapshot->getType(), 'payload' => $this->serializer->serialize($snapshot->getAggregate(), 'json')];
 }