1 | <?php |
||
11 | class SnapshotService extends Service |
||
12 | { |
||
13 | /** @var SnapshotConfig */ |
||
14 | private $config; |
||
15 | |||
16 | /** @var FileManager */ |
||
17 | private $files; |
||
18 | |||
19 | /** |
||
20 | * SnapshotService constructor. |
||
21 | * |
||
22 | * @param SnapshotConfig $config |
||
23 | * @param FileManager $files |
||
24 | */ |
||
25 | public function __construct(SnapshotConfig $config, FileManager $files) |
||
30 | |||
31 | /** |
||
32 | * Get snapshots. |
||
33 | * |
||
34 | * @return PaginableArray |
||
35 | */ |
||
36 | public function getSnapshots(): PaginableArray |
||
54 | |||
55 | /** |
||
56 | * @param string $filename |
||
57 | * @return null|FileSnapshot |
||
58 | */ |
||
59 | public function getSnapshot(string $filename) |
||
67 | |||
68 | /** |
||
69 | * |
||
70 | */ |
||
71 | public function deleteSnapshots() |
||
77 | |||
78 | /** |
||
79 | * @param FileSnapshot $filename |
||
80 | */ |
||
81 | public function deleteSnapshot(FileSnapshot $filename) |
||
85 | |||
86 | /** |
||
87 | * @param string $filename |
||
88 | * @return bool |
||
89 | */ |
||
90 | public function exists(string $filename): bool |
||
94 | |||
95 | /** |
||
96 | * @param FileSnapshot $snapshot |
||
97 | * @return string |
||
98 | */ |
||
99 | public function read(FileSnapshot $snapshot): string |
||
103 | } |