Conditions | 3 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
43 | public function __construct(AggregateRoot $aggregateRoot) |
||
44 | { |
||
45 | if ($aggregateRoot->getRecordedAggregateEvents()->count() !== 0 |
||
46 | || $aggregateRoot->getRecordedEvents()->count() !== 0 |
||
47 | ) { |
||
48 | throw new SnapshotStoreException('Cannot create an snapshot of an Aggregate root with recorded events'); |
||
49 | } |
||
50 | |||
51 | $this->storeStream = GenericStoreStream::fromAggregateRoot($aggregateRoot); |
||
52 | $this->aggregateRoot = $aggregateRoot; |
||
53 | } |
||
71 |