| 1 | <?php |
||
| 7 | class Snapshotter |
||
| 8 | { |
||
| 9 | private $snapshotStrategies = []; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @param string $aggregateClass |
||
| 13 | * @param ReflectionSnapshotTranslator $snapshotStrategy |
||
| 14 | */ |
||
| 15 | 3 | public function addSnapshotTranslator($aggregateClass, $snapshotStrategy) |
|
| 19 | |||
| 20 | /** |
||
| 21 | * @param EventSourcedAggregateRootInterface $aggregate |
||
| 22 | * @return SnapshotInterface |
||
| 23 | */ |
||
| 24 | 1 | public function takeSnapshot($aggregate) |
|
| 28 | |||
| 29 | /** |
||
| 30 | * @param SnapshotInterface $snapshot |
||
| 31 | * @return EventSourcedAggregateRootInterface |
||
| 32 | */ |
||
| 33 | 2 | public function translateSnapshot($snapshot) |
|
| 37 | } |
||
| 38 |