setName("ot:site:clear-cache") ->setDescription("Clear the cache of an organization website") ->setHelp("This CLI command clears the cache of an existing organization's website") ->addArgument( 'organization-id', InputArgument::REQUIRED, "The organization's id in the opentalent DB" )->addOption( 'all', 'a', InputOption::VALUE_NONE, 'Use this option to clear all the typo3 caches, and not only the frontend one' ); } /** * -- This method is expected by Typo3, do not rename ou remove -- * * @param InputInterface $input * @param OutputInterface $output * @throws \Exception */ protected function execute(InputInterface $input, OutputInterface $output): int { $org_id = $input->getArgument('organization-id'); $clearAll = $input->getOption('all'); $io = new SymfonyStyle($input, $output); $rootUid = $this->siteController->clearSiteCacheAction($org_id, $clearAll); $io->success(sprintf("The cache has been cleared for the website with root uid " . $rootUid . "")); return 0; } }