eZ\Bundle\EzPublishLegacySearchEngineBundle\Command\CreateIndexCommand::initialize PHP Method

initialize() public method

Initialize objects required by {@see execute()}.
public initialize ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    public function initialize(InputInterface $input, OutputInterface $output)
    {
        parent::initialize($input, $output);
        $this->logger = $this->getContainer()->get('logger');
        $this->searchHandler = $this->getContainer()->get('ezpublish.spi.search');
        $this->persistenceHandler = $this->getContainer()->get('ezpublish.api.persistence_handler');
        $this->databaseHandler = $this->getContainer()->get('ezpublish.connection');
        if (!$this->searchHandler instanceof SearchHandler) {
            throw new RuntimeException('Expected to find Legacy Search Engine but found something else.' . "Did you forget to configure the repository with 'legacy' search engine?");
        }
    }