Exemplo n.º 1
0
 /**
  * @param TakeSnapshot $command
  */
 public function __invoke(TakeSnapshot $command)
 {
     $repository = $this->aggregateRepositories[$command->aggregateType()];
     $aggregateRoot = $repository->getAggregateRoot($command->aggregateId());
     $this->snapshotAdapter->add(new Snapshot(AggregateType::fromAggregateRootClass($command->aggregateType()), $command->aggregateId(), $aggregateRoot, $command->version(), $command->createdAt()));
 }