1 | <?php |
||
9 | class RollbackCommand extends AbstractCommand |
||
10 | { |
||
11 | /** |
||
12 | * Migrator instance. |
||
13 | * |
||
14 | * @var Migrator |
||
15 | */ |
||
16 | protected $migrator; |
||
17 | |||
18 | protected static $defaultName = 'rollback'; |
||
19 | |||
20 | /** |
||
21 | * Constructor. |
||
22 | * |
||
23 | * @param Migrator $migrator |
||
24 | * @param string|null $name |
||
25 | */ |
||
26 | public function __construct(Migrator $migrator, $name = null) |
||
32 | |||
33 | /** |
||
34 | * Configures the current command. |
||
35 | */ |
||
36 | protected function configure() |
||
42 | |||
43 | /** |
||
44 | * Execute the console command. |
||
45 | * |
||
46 | * @return null|int |
||
47 | */ |
||
48 | protected function fire() |
||
64 | |||
65 | /** |
||
66 | * Call rollback. |
||
67 | * |
||
68 | * @param $migration |
||
69 | * |
||
70 | * @return null |
||
71 | */ |
||
72 | protected function rollbackMigration($migration) |
||
82 | |||
83 | /** |
||
84 | * Call hard rollback. |
||
85 | * |
||
86 | * @param $migration |
||
87 | * |
||
88 | * @return null |
||
89 | */ |
||
90 | protected function hardRollbackMigration($migration) |
||
96 | |||
97 | /** |
||
98 | * Ask a user to confirm rolling back non-existing migration and remove it from log. |
||
99 | * |
||
100 | * @param $migration |
||
101 | * |
||
102 | * @return void |
||
103 | */ |
||
104 | protected function markRolledBackWithConfirmation($migration) |
||
115 | |||
116 | /** |
||
117 | * Delete migration file if options is set |
||
118 | * |
||
119 | * @param string $migration |
||
120 | * |
||
121 | * @return null |
||
122 | */ |
||
123 | protected function deleteIfNeeded($migration) |
||
133 | } |
||
134 |