Knp\Bundle\KnpBundlesBundle\Command\KbSolrReindexCommand::execute PHP Метод

execute() защищенный Метод

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $indexer = $this->getContainer()->get('knp_bundles.indexer.solr');
        $indexer->deleteBundlesIndexes();
        $doctrine = $this->getContainer()->get('doctrine');
        $bundles = $doctrine->getRepository('KnpBundlesBundle:Bundle')->findAll();
        $count = count($bundles);
        foreach ($bundles as $key => $bundle) {
            try {
                $indexer->indexBundle($bundle);
                $this->printOutput($output, $key, $count);
            } catch (Exception $e) {
                $output->writeln(sprintf("<error>Exception: %s, skipping bundle %s.</error>", $e->getMessage(), $bundle->getFullName()));
            }
            unset($bundles[$key]);
        }
    }