FOSElasticaBundle/Command/PopulateCommand.php
2011-04-12 15:15:48 -07:00

39 lines
941 B
PHP

<?php
namespace FOQ\ElasticaBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\Output;
/**
* Populate the search index
*/
class PopulateCommand extends Command
{
/**
* @see Command
*/
protected function configure()
{
$this
->setName('foq:elastica:populate')
->setDescription('Populates search indexes from providers');
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('Populating indexes');
$populator = $this->container->get('foq_elastica.populator')->populate();
$output->writeln('Done');
}
}