tableService = $tableService; $this->logger = $logger; } protected function configure(): void { $this ->setName('tables:remove') ->setDescription('Remove a table.') ->addArgument( 'ID', InputArgument::REQUIRED, 'ID for the table.' ) ; } /** * @param InputInterface $input * @param OutputInterface $output * @return int */ protected function execute(InputInterface $input, OutputInterface $output): int { $id = $input->getArgument('ID'); try { $this->tableService->delete($id, ''); $output->writeln('Table deleted.'); } catch (InternalError|PermissionError|Exception $e) { $output->writeln('Error occurred: ' . $e->getMessage()); $this->logger->warning('Following error occurred during executing occ command "' . self::class . '"', ['exception' => $e]); return 1; } return 0; } }