| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace Opentalent\OtAdmin\Command;
- use Opentalent\OtAdmin\Controller\SiteController;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Style\SymfonyStyle;
- /**
- * This CLI command update an existing organization's website
- * with the latest data from the Opentalent DB
- *
- * @package Opentalent\OtAdmin\Command
- */
- class UpdateSiteCommand extends Command
- {
- /**
- * -- This method is expected by Typo3, do not rename ou remove --
- *
- * Allows to configure the command.
- * Allows to add a description, a help text, and / or define arguments.
- *
- */
- protected function configure()
- {
- $this
- ->setName("ot:site:update")
- ->setDescription("Update an organization website")
- ->setHelp("This CLI command update an existing organization's website
- with the latest data from the Opentalent DB")
- ->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
- * @throws \Exception
- */
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $org_id = $input->getArgument('organization_id');
- $io = new SymfonyStyle($input, $output);
- $siteController = new SiteController();
- $rootUid = $siteController->updateSiteConstantsAction($org_id);
- $io->success(sprintf("The website with root uid " . $rootUid . " has been updated"));
- }
- }
|