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, it will create it; If a site already exists, it won't do anything.") ->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 -- * * @param InputInterface $input * @param OutputInterface $output * @return int * @throws \Exception */ protected function execute(InputInterface $input, OutputInterface $output) { $org_id = $input->getArgument('organization-id'); $io = new SymfonyStyle($input, $output); $rootUid = $this->siteController->createSiteAction($org_id); $io->success(sprintf("A new website has been created with root page uid=" . $rootUid)); return 0; } }