示例#1
0
 /**
  * {@inheritDoc}
  */
 public function bake($name)
 {
     EventManager::instance()->on('Bake.initialize', function (Event $event) {
         $event->subject->loadHelper('Migrations.Migration');
     });
     return parent::bake($name);
 }
 /**
  * Gets the option parser instance and configures it.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description('Bake migration snapshot class.')->addOption('require-table', ['boolean' => true, 'default' => false, 'help' => 'If require-table is set to true, check also that the table class exists.'])->addOption('disable-autoid', ['boolean' => true, 'default' => false, 'help' => 'Disable phinx behavior of automatically adding an id field.']);
     return $parser;
 }
 /**
  * Gets the option parser instance and configures it.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description('Bake migration snapshot class.')->addArgument('name', ['help' => 'Name of the migration to bake. Can use Plugin.name to bake migration files into plugins.', 'required' => true])->addOption('require-table', ['boolean' => true, 'default' => false, 'help' => 'If require-table is set to true, check also that the table class exists.'])->addOption('disable-autoid', ['boolean' => true, 'default' => false, 'help' => 'Disable phinx behavior of automatically adding an id field.']);
     return $parser;
 }
 /**
  * Gets the option parser instance and configures it.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description('Bake migration snapshot class.')->addOption('require-table', ['boolean' => true, 'default' => false, 'help' => 'If require-table is set to true, check also that the table class exists.']);
     return $parser;
 }
示例#5
0
 /**
  * Gets the option parser instance and configures it.
  *
  * @return \Cake\Console\ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addArgument('name', ['help' => 'Name of the migration to bake. Can use Plugin.name to bake migration files into plugins.', 'required' => true]);
     return $parser;
 }