1 | <?php |
||
5 | class InMemorySnapshotStore implements SnapshotStoreInterface |
||
6 | { |
||
7 | /** |
||
8 | * @var SnapshotInterface[] |
||
9 | */ |
||
10 | private $snapshots; |
||
11 | |||
12 | /** |
||
13 | * @param SnapshotInterface[] $snapshots |
||
14 | */ |
||
15 | 15 | public function __construct(array $snapshots = []) |
|
19 | |||
20 | /** |
||
21 | * @param SnapshotInterface $snapshot |
||
22 | */ |
||
23 | 1 | public function addSnapshot($snapshot) |
|
27 | |||
28 | /** |
||
29 | * @param string $aggregateClass |
||
30 | * @param string $aggregateId |
||
31 | * @return SnapshotInterface|null |
||
32 | */ |
||
33 | 3 | public function findLastSnapshot($aggregateClass, $aggregateId) |
|
43 | |||
44 | /** |
||
45 | * @param string $aggregateClass |
||
46 | * @param string $aggregateId |
||
47 | * @param int $version |
||
48 | * @return SnapshotInterface|null |
||
49 | */ |
||
50 | 4 | public function findNearestSnapshotToVersion($aggregateClass, $aggregateId, $version) |
|
69 | } |
||
70 |