Ejemplo n.º 1
0
 /**
  * execute
  *
  * @see Command
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     $session = $this->mustBeModelManagerSession($this->getSession());
     $this->pathFile = $this->getPathFile($input->getArgument('config-name'), $this->relation, 'Model', '', $input->getOption('psr4'));
     $this->namespace = $this->getNamespace($input->getArgument('config-name'));
     $this->updateOutput($output, (new ModelGenerator($session, $this->schema, $this->relation, $this->pathFile, $this->namespace))->generate(new ParameterHolder(['force' => $input->getOption('force')])));
 }
Ejemplo n.º 2
0
 /**
  * execute
  *
  * @see Command
  * @throws CliException
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     $this->relation = $input->getArgument('relation');
     $this->relation_oid = $this->getSession()->getInspector()->getTableOid($this->schema, $this->relation);
     if ($this->relation_oid === null) {
         throw new CliException(sprintf("Relation <comment>%s.%s</comment> not found.", $this->schema, $this->relation));
     }
     $fields_infos = $this->getSession()->getInspector()->getTableFieldInformation($this->relation_oid);
     $this->formatOutput($output, $fields_infos);
 }
Ejemplo n.º 3
0
 /**
  * execute
  *
  * @see Command
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     $session = $this->mustBeModelManagerSession($this->getSession());
     $this->updateOutput($output, (new StructureGenerator($session, $this->schema, $this->relation, $this->getPathFile($input->getArgument('config-name'), $this->relation, null, 'AutoStructure', $input->getOption('psr4')), $this->getNamespace($input->getArgument('config-name'), 'AutoStructure')))->generate(new ParameterHolder(array_merge($input->getArguments(), $input->getOptions()))));
     $pathFile = $this->getPathFile($input->getArgument('config-name'), $this->relation, 'Model', '', $input->getOption('psr4'));
     if (!file_exists($pathFile) || $input->getOption('force')) {
         $this->updateOutput($output, (new ModelGenerator($session, $this->schema, $this->relation, $pathFile, $this->getNamespace($input->getArgument('config-name'))))->generate(new ParameterHolder(array_merge($input->getArguments(), $input->getOptions()))));
     } elseif ($output->isVerbose()) {
         $this->writelnSkipFile($output, $pathFile, 'model');
     }
     $pathFile = $this->getPathFile($input->getArgument('config-name'), $this->relation, '', '', $input->getOption('psr4'));
     if (!file_exists($pathFile) || $input->getOption('force')) {
         $this->updateOutput($output, (new EntityGenerator($session, $this->schema, $this->relation, $pathFile, $this->getNamespace($input->getArgument('config-name')), $this->flexible_container))->generate(new ParameterHolder(array_merge($input->getArguments(), $input->getOptions()))));
     } elseif ($output->isVerbose()) {
         $this->writelnSkipFile($output, $pathFile, 'entity');
     }
 }