/** * 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')]))); }
/** * 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); }
/** * 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'); } }