1 | <?php |
||
12 | class TimeBased implements SnapshottingPolicy |
||
13 | { |
||
14 | /** |
||
15 | * @var SnapshotStore |
||
16 | */ |
||
17 | private $store; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $threshold; |
||
23 | |||
24 | public function __construct(SnapshotStore $store, $threshold = '1 hour') |
||
29 | |||
30 | /** |
||
31 | * Should a snapshot be created? |
||
32 | * |
||
33 | * @param AggregateRoot $root |
||
34 | * @return bool |
||
35 | */ |
||
36 | public function shouldCreateSnapshot(AggregateRoot $root) |
||
49 | } |
||
50 |