1 | <?php |
||
14 | abstract class BackupCommandAbstract extends Command implements BackupCommandInterface |
||
15 | { |
||
16 | /** |
||
17 | * Backup factory. |
||
18 | * |
||
19 | * @var BackupFactory |
||
20 | */ |
||
21 | protected $backupFactory; |
||
22 | |||
23 | /** |
||
24 | * Config instance. |
||
25 | * |
||
26 | * @var Config |
||
27 | */ |
||
28 | protected $configInstance; |
||
29 | |||
30 | /** |
||
31 | * Backup instance. |
||
32 | * |
||
33 | * @var BackupInterface |
||
34 | */ |
||
35 | protected $backupInstance; |
||
36 | |||
37 | /** |
||
38 | * Base command constructor. |
||
39 | * |
||
40 | * @param BackupFactory $backupFactory |
||
41 | * @param Config $configInstance |
||
42 | */ |
||
43 | public function __construct(BackupFactory $backupFactory, Config $configInstance) |
||
49 | |||
50 | /** |
||
51 | * Get a backup instance. |
||
52 | * |
||
53 | * @param string $database |
||
54 | * |
||
55 | * @return BackupInterface |
||
56 | */ |
||
57 | public function getBackupInstance($database = null): BackupInterface |
||
64 | |||
65 | /** |
||
66 | * Handle. |
||
67 | * |
||
68 | * @return void |
||
69 | */ |
||
70 | abstract public function handle(): void; |
||
71 | |||
72 | /** |
||
73 | * Get config by name. |
||
74 | * |
||
75 | * @param string $name |
||
76 | * |
||
77 | * @return array|string |
||
78 | */ |
||
79 | protected function getConfig($name) |
||
83 | } |
||
84 |