1 | <?php |
||
18 | class OnePerGroup implements Keeper |
||
19 | { |
||
20 | /** |
||
21 | * Grouping date format f.e. 'Ymd'. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | private $group; |
||
26 | |||
27 | /** |
||
28 | * List of groups containing the files. |
||
29 | * |
||
30 | * @var \phpbu\App\Backup\File[] |
||
31 | */ |
||
32 | private $groups = []; |
||
33 | |||
34 | /** |
||
35 | * OnePerGroup constructor. |
||
36 | * |
||
37 | * @param string $group |
||
38 | */ |
||
39 | public function __construct(string $group) |
||
43 | |||
44 | /** |
||
45 | * Decides if given file should be kept. |
||
46 | * |
||
47 | * @param \phpbu\App\Backup\File $file |
||
48 | * @return bool |
||
49 | */ |
||
50 | public function keep(File $file) : bool |
||
58 | } |
||
59 |