setName("ot:site:undelete") ->setDescription("Undo the soft-deletion of an organization website and update it") ->setHelp("Call this method by giving it the organization's id in the Opentalent DB. If an organization website has been deleted with the ot:site:delete command and without the --hard option, you can undo the deletion with this command.") ->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 * @return int * @throws \Exception */ protected function execute(InputInterface $input, OutputInterface $output): int { $org_id = $input->getArgument('organization-id'); $io = new SymfonyStyle($input, $output); $siteController = GeneralUtility::makeInstance(ObjectManager::class)->get(SiteController::class); $rootUid = $siteController->undeleteSiteAction($org_id); $siteController->updateSiteAction($org_id); $io->success(sprintf("The website with root uid " . $rootUid . " has been restored")); return 0; } }