first commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\CatalogBundle\Command;
|
||||
|
||||
use KupShop\AdminBundle\FulltextUpdatesTrait;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
#[AsCommand(name: 'kupshop:elastic:update', description: 'Update ElasticSearch indices')]
|
||||
class UpdateElasticIndexCommand extends Command
|
||||
{
|
||||
use FulltextUpdatesTrait;
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$this->addArgument('type', InputArgument::OPTIONAL, default: 'all');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->updateIndices($input->getArgument('type'));
|
||||
$output->writeln('<info>Done - indices updated</info>');
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user