setStopOnError example



    /** * {@inheritdoc} */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $helper = new ConsoleProgressHelper($output);

        $this->evaluationHelper->setOutput($output);
        $this->evaluationHelper->setActive(!$input->getOption('no-evaluation'));
        $this->evaluationHelper->setStopOnError($input->getOption('stop-on-error'));

        foreach ($this->getShops($input$output) as $shop) {
            $output->writeln("\n## Indexing shop " . $shop->getName() . ' ##');
            $this->shopIndexer->index($shop$helper$input->getOption('index'));
        }

        return 0;
    }

    /** * @return array<Shop> */

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        /** @var EsBackendIndexer $indexer */
        $indexer = $this->container->get('shopware_es_backend.indexer');

        $helper = new ConsoleProgressHelper($output);
        $evaluation = $this->container->get(\Shopware\Bundle\ESIndexingBundle\Console\EvaluationHelperInterface::class);
        $evaluation->setOutput($output)
            ->setActive(!$input->getOption('no-evaluation'))
            ->setStopOnError($input->getOption('stop-on-error'));

        $indexer->index($helper);

        return 0;
    }
}
Home | Imprint | This part of the site doesn't use cookies.