| 1 | <?php |
||
| 8 | class ArchiveCommand extends AbstractCommand |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Migrator instance. |
||
| 12 | * |
||
| 13 | * @var Migrator |
||
| 14 | */ |
||
| 15 | protected $migrator; |
||
| 16 | protected static $defaultName = 'archive'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Constructor. |
||
| 20 | * |
||
| 21 | * @param Migrator $migrator |
||
| 22 | * @param string|null $name |
||
| 23 | */ |
||
| 24 | public function __construct(Migrator $migrator, $name = null) |
||
| 25 | { |
||
| 26 | $this->migrator = $migrator; |
||
| 27 | |||
| 28 | parent::__construct($name); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Configures the current command. |
||
| 33 | */ |
||
| 34 | protected function configure() |
||
| 35 | { |
||
| 36 | $this->setDescription('Move migration into archive') |
||
| 37 | ->addOption('without', 'w', InputOption::VALUE_REQUIRED, 'Archive without last N migration'); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Execute the console command. |
||
| 42 | * |
||
| 43 | * @return null|int |
||
| 44 | */ |
||
| 45 | protected function fire() |
||
| 61 | } |
||
| 62 |