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" )->addOption( 'dev', null, InputOption::VALUE_NONE, "Add this option to get url like 'http://host/subdomain' instead of 'http://subdomain/host'" ); } /** * -- 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 * @throws \Exception */ protected function execute(InputInterface $input, OutputInterface $output) { $org_id = $input->getArgument('organization_id'); $isDev = $input->getOption('dev'); $io = new SymfonyStyle($input, $output); $siteController = new SiteController(); $rootUid = $siteController->createSiteAction( $org_id, $isDev ? $siteController::MODE_DEV : $siteController::MODE_PROD ); $io->success(sprintf("A new website has been created with root page uid=" . $rootUid)); } }