| 1 | <?php |
||
| 13 | class InMemorySnapshotStore implements SnapshotStore |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * Snapshots by identity |
||
| 17 | * @var array |
||
| 18 | */ |
||
| 19 | private $snapshots = []; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Get the latest snapshot for given $id |
||
| 23 | * |
||
| 24 | * @param Identity $id |
||
| 25 | * @param null $criteria |
||
| 26 | * @return Snapshot |
||
| 27 | */ |
||
| 28 | public function get(Identity $id, $criteria = null) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Save given snapshot |
||
| 39 | * |
||
| 40 | * @param AggregateRoot $root |
||
| 41 | */ |
||
| 42 | public function save(AggregateRoot $root) |
||
| 52 | } |
||
| 53 |