setName("ot:site:infos") ->setDescription("Display the main informations about the organization's website") ->addArgument( 'organization_id', InputArgument::REQUIRED, "The organization's id in the opentalent DB" ); } /** * -- This method is expected by Typo3, do not rename ou remove -- * * @param InputInterface $input * @param OutputInterface $output * @throws \Exception */ protected function execute(InputInterface $input, OutputInterface $output) { $org_id = $input->getArgument('organization_id'); $io = new SymfonyStyle($input, $output); $siteController = GeneralUtility::makeInstance(ObjectManager::class)->get(SiteController::class); $infos = $siteController->getSiteInfosAction($org_id); $io->title(sprintf("Informations about the organization " . $org_id . ' typo3 website')); $headers = []; $values = []; foreach ($infos as $key => $value) { $headers[] = $key; $values[] = json_encode( str_replace("\"", "'", $value), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES ); } $io->horizontalTable($headers, [$values]); $io->success(sprintf('Informations retrieved')); } }