상속: extends BaseGenerator
 /**
  * Execute the command.
  *
  * @return void
  */
 public function handle()
 {
     parent::handle();
     $this->initAPIGeneratorCommandData();
     if (!$this->commandData->options['fromTable']) {
         $migrationGenerator = new MigrationGenerator($this->commandData);
         $migrationGenerator->generate();
     }
     $modelGenerator = new ModelGenerator($this->commandData);
     $modelGenerator->generate();
     $repositoryGenerator = new RepositoryGenerator($this->commandData);
     $repositoryGenerator->generate();
     $controllerGenerator = new APIControllerGenerator($this->commandData);
     $controllerGenerator->generate();
     $requestGenerator = new APIRequestGenerator($this->commandData);
     $requestGenerator->generate();
     $routesGenerator = new APIRoutesGenerator($this->commandData);
     $routesGenerator->generate();
     if ($this->commandData->getAddOn('tests')) {
         $repositoryTestGenerator = new RepositoryTestGenerator($this->commandData);
         $repositoryTestGenerator->generate();
         $testTraitGenerator = new TestTraitGenerator($this->commandData);
         $testTraitGenerator->generate();
         $apiTestGenerator = new ApiTestGenerator($this->commandData);
         $apiTestGenerator->generate();
     }
     $this->performPostActionsWithMigration();
 }
 /**
  * Execute the command.
  *
  * @return void
  */
 public function handle()
 {
     parent::handle();
     if ($this->commandData->getOption('fromTable')) {
         $this->error('fromTable option is now allowed to use with migration generator');
         return;
     }
     $migrationGenerator = new MigrationGenerator($this->commandData);
     $migrationGenerator->generate();
     $this->performPostActionsWithMigration();
 }
 /**
  * Execute the command.
  *
  * @return void
  */
 public function handle()
 {
     if (!in_array($this->argument('type'), [CommandData::$COMMAND_TYPE_API, CommandData::$COMMAND_TYPE_SCAFFOLD, CommandData::$COMMAND_TYPE_API_SCAFFOLD])) {
         $this->error('invalid rollback type');
     }
     $this->commandData = new CommandData($this, $this->argument('type'));
     $this->commandData->config->mName = $this->commandData->modelName = $this->argument('model');
     $this->commandData->config->prepareOptions($this->commandData, ['tableName', 'prefix']);
     $this->commandData->config->prepareAddOns();
     $this->commandData->config->prepareModelNames();
     $this->commandData->config->prepareTableName();
     $this->commandData->config->loadPaths();
     $this->commandData->config->loadNamespaces($this->commandData);
     $this->commandData = $this->commandData->config->loadDynamicVariables($this->commandData);
     $migrationGenerator = new MigrationGenerator($this->commandData);
     $migrationGenerator->rollback();
     $modelGenerator = new ModelGenerator($this->commandData);
     $modelGenerator->rollback();
     $repositoryGenerator = new RepositoryGenerator($this->commandData);
     $repositoryGenerator->rollback();
     $requestGenerator = new APIRequestGenerator($this->commandData);
     $requestGenerator->rollback();
     $controllerGenerator = new APIControllerGenerator($this->commandData);
     $controllerGenerator->rollback();
     $routesGenerator = new APIRoutesGenerator($this->commandData);
     $routesGenerator->rollback();
     $requestGenerator = new RequestGenerator($this->commandData);
     $requestGenerator->rollback();
     $controllerGenerator = new ControllerGenerator($this->commandData);
     $controllerGenerator->rollback();
     $viewGenerator = new ViewGenerator($this->commandData);
     $viewGenerator->rollback();
     $routeGenerator = new RoutesGenerator($this->commandData);
     $routeGenerator->rollback();
     if ($this->commandData->getAddOn('tests')) {
         $repositoryTestGenerator = new RepositoryTestGenerator($this->commandData);
         $repositoryTestGenerator->rollback();
         $testTraitGenerator = new TestTraitGenerator($this->commandData);
         $testTraitGenerator->rollback();
         $apiTestGenerator = new APITestGenerator($this->commandData);
         $apiTestGenerator->rollback();
     }
     if ($this->commandData->config->getAddOn('menu.enabled')) {
         $menuGenerator = new MenuGenerator($this->commandData);
         $menuGenerator->rollback();
     }
     $this->info('Generating autoload files');
     $this->composer->dumpOptimized();
 }
예제 #4
0
 public function generateCommonItems()
 {
     if (!$this->commandData->getOption('fromTable') and !$this->isSkip('migration')) {
         $migrationGenerator = new MigrationGenerator($this->commandData);
         $migrationGenerator->generate();
     }
     if (!$this->isSkip('model')) {
         $modelGenerator = new ModelGenerator($this->commandData);
         $modelGenerator->generate();
     }
     if (!$this->isSkip('repository')) {
         $repositoryGenerator = new RepositoryGenerator($this->commandData);
         $repositoryGenerator->generate();
     }
 }
 /**
  * Execute the command.
  *
  * @return void
  */
 public function handle()
 {
     parent::handle();
     $this->initScaffoldGeneratorCommandData();
     if (!$this->commandData->options['fromTable']) {
         $migrationGenerator = new MigrationGenerator($this->commandData);
         $migrationGenerator->generate();
     }
     $modelGenerator = new ModelGenerator($this->commandData);
     $modelGenerator->generate();
     $repositoryGenerator = new RepositoryGenerator($this->commandData);
     $repositoryGenerator->generate();
     $requestGenerator = new RequestGenerator($this->commandData);
     $requestGenerator->generate();
     $controllerGenerator = new ControllerGenerator($this->commandData);
     $controllerGenerator->generate();
     $viewGenerator = new ViewGenerator($this->commandData);
     $viewGenerator->generate();
     $routeGenerator = new RoutesGenerator($this->commandData);
     $routeGenerator->generate();
     $this->performPostActionsWithMigration();
 }