setName("ot:site:create") ->setDescription("Create an organization's website " . "by fetching its latest data from the Opentalent API") ->setHelp("Call this method by giving it the organization's id in the Opentalent DB. If no site exists, create it; If a site already exists, do nothing.") ->addArgument( 'organization_id', InputArgument::REQUIRED, "The organization's id in the opentalent DB" ); } /** * -- This method is expected by Typo3, do not rename ou remove -- * * Executes the command for creating the new organization * * @param InputInterface $input * @param OutputInterface $output */ protected function execute(InputInterface $input, OutputInterface $output) { // Make sure the _cli_ user is loaded // TYPO3\CMS\Core\Core\Bootstrap::initializeBackendAuthentication(); $org_id = $input->getArgument('organization_id'); $io = new SymfonyStyle($input, $output); $siteController = new SiteController(); $rootUid = $siteController->createSiteAction($org_id); $io->success(sprintf("A new website has been created with root page uid=" . $rootUid)); } }